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.
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
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Jan 11 2011
STATUS
approved