OFFSET
0,3
LINKS
Ivan Panchenko, Table of n, a(n) for n = 0..1000
FORMULA
a(0)=0, a(n)=(a(n-1)+n) OR n, where OR is the bitwise logical inclusive-OR operator.
MATHEMATICA
nxt[{n_, a_}]:={n+1, BitOr[a+n+1, n+1]}; NestList[nxt, {0, 0}, 50][[All, 2]] (* Harvey P. Dale, Aug 16 2021 *)
PROG
(Python)
a=0
for i in range(1, 51):
print(a, end=', ')
a += i
a |= i
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Alex Ratushnyak, Apr 20 2012
STATUS
approved