OFFSET
1,3
COMMENTS
See A156595.
LINKS
Andrew Howroyd, Table of n, a(n) for n = 1..10000
Kevin Ryde, Iterations of the Terdragon Curve, see index "AltTurnsR".
FORMULA
a(n) = floor((n+1)/3) + floor(n/3) - a(floor(n/3)), with a(0) = 0.
MATHEMATICA
(See A189715.)
PROG
(PARI) a(n) = {if(n<=0, 0, (n+1)\3 + n\3 - a(n\3))} \\ Andrew Howroyd, Sep 10 2019
(PARI) a(n) = (n - subst(Pol(digits(n, 3)%2), 'x, -1))/2; \\ Kevin Ryde, Jul 18 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Apr 26 2011
STATUS
approved