(Translated by https://www.hiragana.jp/)
A229745 - OEIS
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
Kenneth B. Stolarsky, The sum of a digitaddition series, Proc. Amer. Math. Soc. 59 (1976), no. 1, 1--5. MR0409340 (53 #13099)
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
Sequence in context: A269242 A321759 A076882 * A339366 A016397 A238450
KEYWORD
sign
AUTHOR
N. J. A. Sloane, Oct 08 2013
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 26 13:18 EDT 2024. Contains 375456 sequences. (Running on oeis4.)