OFFSET
0,3
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8191
FORMULA
MATHEMATICA
Table[DigitCount[2 n - DigitCount[2 n, 2, 1], 2, 1], {n, 0, 120}] (* Michael De Vlieger, Mar 18 2017 *)
PROG
(PARI)
b(n) = if(n<1, 0, b(n\2) + n%2);
for(n=0, 150, print1(b(2*n - b(2*n)), ", ")) \\ Indranil Ghosh, Mar 21 2017
(Python)
def A(n): return bin(2*n - bin(2*n)[2:].count("1"))[2:].count("1")
print([A(n) for n in range(151)]) # Indranil Ghosh, Mar 21 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 16 2017
STATUS
approved