OFFSET
0,4
FORMULA
a(0)=0, a(1)=1, a(n) = a(n-1) + (a(n-2) AND n), where AND is the bitwise AND operator.
MATHEMATICA
RecurrenceTable[{a[0]==0, a[1]==1, a[n]==a[n-1]+BitAnd[a[n-2], n]}, a, {n, 70}] (* Harvey P. Dale, Jan 23 2013 *)
PROG
(Python)
prpr, prev = 0, 1
for n in range(2, 99):
. current = prev + (prpr & n)
. print prpr,
. prpr, prev = prev, current
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Alex Ratushnyak, May 04 2012
STATUS
approved