A234022 a(n) = A000120(A193231(n)); number of 1-bits in blue code for n.
0, 1, 2, 1, 2, 1, 2, 3, 4, 3, 2, 3, 2, 3, 2, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 5, 4, 3, 4, 3, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 5, 4, 3, 4, 5, 2, 3, 2, 1, 4, 3, 2, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 3, 4, 5, 2, 3, 4, 3, 4, 5, 4, 3, 6, 5, 4, 5, 2, 3, 4, 3, 2, 1, 2
Offset: 0
Keywords
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].
Programs
-
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
-
Scheme
(define (A234022 n) (A000120 (A193231 n)))