login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A184617
With nonadjacent forms: A184615(n) + A184616(n).
4
0, 1, 2, 5, 4, 5, 10, 9, 8, 9, 10, 21, 20, 21, 18, 17, 16, 17, 18, 21, 20, 21, 42, 41, 40, 41, 42, 37, 36, 37, 34, 33, 32, 33, 34, 37, 36, 37, 42, 41, 40, 41, 42, 85, 84, 85, 82, 81, 80, 81, 82, 85, 84, 85, 74, 73, 72, 73, 74, 69, 68, 69, 66, 65, 64, 65, 66, 69, 68, 69, 74, 73, 72, 73, 74, 85, 84, 85, 82, 81, 80, 81, 82
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
Joerg Arndt, Matters Computational (The Fxtbook), pages 61-62.
FORMULA
a(n) = A184615(n) + A184616(n).
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
Cf. A178729.
Cf. A184615 (positive parts), A184616 (negated negative parts).
Sequence in context: A348027 A197288 A053424 * A290886 A163809 A075771
KEYWORD
nonn,look
AUTHOR
Joerg Arndt, Jan 18 2011
STATUS
approved