OFFSET
0,2
COMMENTS
Constructed with a view to obtaining a musically more interesting version of the Thue-Morse sequence. (This was not a success.)
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8192
EXAMPLE
The initial blocks of A010060 are
0, 1, 1,0, 1,0,0,1, 1,0,0,1,0,1,1,0, 1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1, ...
and we add 0, 1, 2, ... to the terms in these blocks to obtain
0, 2, 3,2, 4,3,3,4, 5,4,4,5,4,5,5,4, 6,5,5,6,5,6,6,5,5,6,6,5,6,5,5,6, ...
PROG
(PARI) a(n) = hammingweight(n)%2 + #binary(n) \\ Rémy Sigrist, Nov 11 2020
(Python)
def A303581(n): return (n.bit_count()&1)+n.bit_length() # Chai Wah Wu, Mar 02 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, May 10 2018
EXTENSIONS
More terms from Rémy Sigrist, Nov 11 2020
STATUS
approved