OFFSET
0,3
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..8191
Joerg Arndt, Matters Computational (The Fxtbook), section 1.19 "Invertible transforms on words", pp. 49--55. [Cf. especially pages 50 & 51].
FORMULA
PROG
(Python)
def a065621(n): return n^(2*(n - (n&-n)))
def a048724(n): return n^(2*n)
l=[0, 1]
z=[0, 1]
for n in range(2, 101):
if n%2==0: l.append(a048724(l[n//2]))
else: l.append(a065621(1 + l[(n - 1)//2]))
z.append(bin(l[-1])[2:].count("1"))
print(z) # Indranil Ghosh, Jun 05 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 28 2013
STATUS
approved