|
|
A229745
|
|
a(n) = wt(n+wt(n))-wt(n), where wt(n) is the binary weight of n, A000120(n).
|
|
1
|
|
|
0, 0, 1, 0, 1, 1, -1, -1, 1, 1, 0, 0, 1, -2, -1, -1, 1, 1, 0, 0, 1, -1, 0, 0, 1, 0, 1, 1, 2, -2, -2, -3, 1, 1, 0, 0, 1, -1, 0, 0, 1, 0, 1, 1, 2, -1, -1, -2, 1, 0, 1, 1, 2, 0, 0, -1, 2, 1, 1, -4, -3, -3, -2, -3, 1, 1, 0, 0, 1, -1, 0, 0, 1, 0, 1, 1, 2, -1, -1, -2, 1, 0, 1, 1, 2, 0, 0, -1, 2, 1, 1, -3, -2, -2, -1, -2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,14
|
|
COMMENTS
|
For any positive or negative integer m, there are infinitely many positive integers n such that a(n) = m. [Stolarsky]
|
|
LINKS
|
|
|
MATHEMATICA
|
f[n_] := DigitCount[n, 2, 1]; Table[f[n + f@ n] - f@ n, {n, 120}] (* Michael De Vlieger, Apr 04 2015 *)
|
|
PROG
|
(PARI) a(n) = hammingweight(n+hammingweight(n)) - hammingweight(n); \\ Michel Marcus, Apr 04 2015
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|