OFFSET
0,3
COMMENTS
The representation of {f(n)} resembles a Koch curve (see illustrations in Links section).
The sequence A065359 mod 8 gives the direction at each step as follows:
3 _ 2 _ 1
\_ | _/
\_ | _/
\|/
4 ------.------ 0
_/|\_
_/ | \_
_/ | \_
5 6 7
We can also build {f(n)} with A096268 as follows:
- start at the origin looking to the right,
- for k=0, 1, ...:
- move forward to the next lattice point
(this point is at distance 1 or sqrt(2)),
- if A096268(k)=0
then turn 45 degrees to the left
otherwise turn 90 degrees to the right,
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..16384
Larry Riddle, Koch Curve
Rémy Sigrist, Illustration of first terms
Rémy Sigrist, PARI program for A332204
FORMULA
EXAMPLE
MATHEMATICA
A065359[0] = 0;
A065359[n_] := -Total[(-1)^PositionIndex[Reverse[IntegerDigits[n, 2]]][1]];
g[z_] := z/GCD[Re[z], Im[z]];
Module[{n = 0}, Re[NestList[# + g[(1+I)^A065359[n++]] &, 0, 100]]] (* Paolo Xausa, Aug 28 2024 *)
PROG
(PARI) \\ See Links section.
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 07 2020
STATUS
approved