A332204 a(n) is the real part of f(n) defined by f(0) = 0, and f(n+1) = f(n) + g((1+i)^(A065359(n) mod 8)) (where g(z) = z/gcd(Re(z), Im(z)) and i denotes the imaginary unit).
0, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 17, 16, 17, 17, 18, 19, 20, 21, 22, 22, 23, 24, 25, 26, 26, 27, 28, 29, 30, 31, 31, 32, 31, 31, 32, 33, 33, 34, 35, 36, 37, 38, 39, 39, 40, 41, 42, 43, 43, 44, 45, 46, 47, 48, 49, 49, 50
Offset: 0
Examples
The first terms, alongside f(n) and A065359(n), are: n a(n) f(n) A065359(n) -- ---- ----- ---------- 0 0 0 0 1 1 1 1 2 2 2+i -1 3 3 3 0 4 4 4 1 5 5 5+i 2 6 5 5+2*i 0 7 6 6+2*i 1 8 7 7+3*i -1 9 8 8+2*i 0 10 9 9+2*i -2 11 9 9+i -1 12 10 10 0 13 11 11 1 14 12 12+i -1 15 13 13 0 16 14 14 1
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, Representation of f(n) in the complex plan for n = 0..2^14
- Rémy Sigrist, PARI program for A332204
- Index entries for sequences related to coordinates of 2D curves
Programs
-
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 *)
-
PARI
\\ See Links section.
Comments