OFFSET
1,1
COMMENTS
The binary expansion of a term, say (b_1, ..., b_m), encodes an m-periodic nonintersecting infinite walk made of unit steps, with a +90-degree turn (resp. a -90-degree turn) at positions X=k' such that b_k = 1 (resp. b_k = 0) with k = k' mod m.
All positive terms of A002450 belong to this sequence.
LINKS
Rémy Sigrist, Illustration of initial terms
EXAMPLE
See illustration in Links section.
PROG
(PARI) is(n) = { my (b=if (n, binary(n), [0]), d=1, s=[d], z=2*d); b=concat([b, b, b, b]); for (k=1, #b, if (b[k], d*=I, d/=I); if (setsearch(s, z+=d), return (0), s=setunion(s, [z]); z+=d)); return (1) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, May 10 2021
STATUS
approved