OFFSET
1,2
LINKS
David Applegate and N. J. A. Sloane, Table of n, a(n) for n = 1..62
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers [pdf, ps].
David Applegate, Benoit Cloitre, Philippe Deléham and N. J. A. Sloane, Sloping binary numbers: a new sequence related to the binary numbers, J. Integer Seq. 8 (2005), no. 3, Article 05.3.6, 15 pp.
FORMULA
a(n) = 2^(n-1) - (n-1) + Sum_{ k >= 1, k == n-1 mod 2^k } 2^k.
a(0)=0, a(1)=3, for n>1, a(n)= a(n-1) XOR (a(n-1)+n), where XOR is the bitwise exclusive-or operator. - Alex Ratushnyak, Apr 21 2012
EXAMPLE
PROG
(Python)
a=3
print(0, end=', ')
for i in range(2, 55):
print(a, end= ', ')
a ^= a+i
# Alex Ratushnyak, Apr 21 2012
CROSSREFS
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane and David Applegate, Mar 22 2005
STATUS
approved