|
|
A234022
|
|
a(n) = A000120(A193231(n)); number of 1-bits in blue code for n.
|
|
7
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
LINKS
|
|
|
FORMULA
|
A000035(a(n)) = A000035(n) = (n mod 2) for all n. [Even terms occur only on even indices and odd terms only on odd indices, respectively]
|
|
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"))
|
|
CROSSREFS
|
A234023 gives the positions where abs(a(n)-a(n+1)) > 1.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|