OFFSET
0,1
REFERENCES
Letter from Gary W. Adamson concerning Prouhet-Thue-Morse sequence, Nov. 11, 1999.
LINKS
FORMULA
a(0)=0, a(n) = (n + a(floor(n/3))) mod 2. - Alex Ratushnyak, Aug 17 2012
PROG
(Python)
TOP = 1000
a = [0]*TOP
for n in range(1, TOP):
print(a[n-1], end=', ')
a[n] = (n + a[n//3]) % 2
# Alex Ratushnyak, Aug 17 2012
(PARI) a(n)=if(n<1, 0, (a(n\3)+n)%2) \\ Benoit Cloitre, Nov 21 2013
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from James A. Sellers, Dec 11 1999
STATUS
approved