OFFSET
0,3
COMMENTS
No two adjacent bits in the binary representations of a(n) are 1.
The value 0 appears once, otherwise, if the binary representation of a(n) has k set bits then it appears 2^(k-1) times.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10922
Joerg Arndt, Matters Computational (The Fxtbook), pages 61-62.
FORMULA
a(n) = A178729(n)/2 = (n XOR n*3)/2. Note a(2^n) = 2^n. - Alex Ratushnyak, Aug 13 2012
EXAMPLE
See A184615.
MATHEMATICA
a[n_] := Module[{nh, n3, c}, nh = BitShiftRight[n]; n3 = n + nh; c = BitXor[nh, n3]; BitAnd[n3, c] + BitAnd[nh, c]];
Table[a[n], {n, 0, 100}] (* Jean-François Alcover, May 30 2019, from PARI code in A184615 *)
PROG
(PARI) (see A184615)
(Python)
for n in range(77):
print((n^(n*3))/2, end=', ')
# Alex Ratushnyak, Aug 13 2012
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Joerg Arndt, Jan 18 2011
STATUS
approved