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!)
A179868 (Number of 1's in the binary expansion of n) mod 4. 2
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 0, 1, 2, 2, 3, 2, 3, 3, 0, 2, 3, 3, 0, 3, 0, 0, 1, 1, 2, 2, 3, 2, 3, 3, 0, 2, 3, 3, 0, 3, 0, 0, 1, 2, 3, 3, 0, 3, 0, 0, 1, 3, 0, 0, 1, 0, 1, 1, 2, 1, 2, 2, 3, 2, 3, 3, 0, 2, 3, 3, 0, 3, 0, 0, 1, 2, 3, 3, 0, 3, 0, 0, 1, 3, 0, 0, 1, 0, 1, 1, 2, 2, 3, 3, 0, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
This is the generalized Thue-Morse sequence t_4 (Allouche and Shallit, p. 335).
REFERENCES
J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003.
LINKS
FORMULA
a(n) = A010873(A000120(n)).
MATHEMATICA
Nest[ Flatten[ # /. {0 -> {0, 1}, 1 -> {1, 2}, 2 -> {2, 3}, 3 -> {3, 0}}] &, {0}, 7] (* Robert G. Wilson v, May 17 2014 *)
Table[Mod[DigitCount[n, 2, 1], 4], {n, 0, 110}] (* Harvey P. Dale, Jul 24 2016 *)
PROG
(PARI) a(n)=hammingweight(n)%4 \\ Charles R Greathouse IV, May 09 2016
CROSSREFS
Cf. A000120, A010873, A010060 (mod 2), A071858 (mod 3).
Sequence in context: A144016 A354582 A359312 * A104232 A072086 A180094
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jan 11 2011
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 February 21 04:08 EST 2024. Contains 370219 sequences. (Running on oeis4.)