OFFSET
1
LINKS
FORMULA
a(3k-2)=0, a(3k-1)=1-a(k), a(3k)=1 for k>=1, a(0)=0.
EXAMPLE
0->011->011001001->...
MATHEMATICA
PROG
(PARI) a(n) = n--; my(ret=0); while([n, r]=divrem(n, 3); r==1, ret++); (ret+r>>1)%2; \\ Kevin Ryde, Jun 02 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Apr 25 2011
STATUS
approved