cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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).

This page as a plain text file.
%I A332204 #43 Aug 30 2024 10:18:56
%S A332204 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,
%T A332204 20,21,22,22,23,24,25,26,26,27,28,29,30,31,31,32,31,31,32,33,33,34,35,
%U A332204 36,37,38,39,39,40,41,42,43,43,44,45,46,47,48,49,49,50
%N 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).
%C A332204 The representation of {f(n)} resembles a Koch curve (see illustrations in Links section).
%C A332204 The sequence A065359 mod 8 gives the direction at each step as follows:
%C A332204          3 _     2     _ 1
%C A332204             \_   |   _/
%C A332204               \_ | _/
%C A332204                 \|/
%C A332204          4 ------.------ 0
%C A332204                _/|\_
%C A332204              _/  |  \_
%C A332204            _/    |    \_
%C A332204          5       6       7
%C A332204 We can also build {f(n)} with A096268 as follows:
%C A332204 - start at the origin looking to the right,
%C A332204 - for k=0, 1, ...:
%C A332204     - move forward to the next lattice point
%C A332204       (this point is at distance 1 or sqrt(2)),
%C A332204     - if A096268(k)=0
%C A332204       then turn 45 degrees to the left
%C A332204       otherwise turn 90 degrees to the right,
%C A332204 - this connects the first differences of A065359 and A096268.
%H A332204 Rémy Sigrist, <a href="/A332204/b332204.txt">Table of n, a(n) for n = 0..16384</a>
%H A332204 Larry Riddle, <a href="http://ecademy.agnesscott.edu/~lriddle/ifs/kcurve/kcurve.htm">Koch Curve</a>
%H A332204 Rémy Sigrist, <a href="/A332204/a332204_1.png">Illustration of first terms</a>
%H A332204 Rémy Sigrist, <a href="/A332204/a332204_2.png">Representation of f(n) in the complex plan for n = 0..2^14</a>
%H A332204 Rémy Sigrist, <a href="/A332204/a332204.gp.txt">PARI program for A332204</a>
%H A332204 <a href="/index/Con#coordinates_2D_curves">Index entries for sequences related to coordinates of 2D curves</a>
%F A332204 a(2^k) = A217730(k) for any k >= 0.
%F A332204 a(4^k+m) + a(m) = A217730(2*k) for any k >= 0 and m = 0..4^k.
%e A332204 The first terms, alongside f(n) and A065359(n), are:
%e A332204   n   a(n)  f(n)   A065359(n)
%e A332204   --  ----  -----  ----------
%e A332204    0     0      0           0
%e A332204    1     1      1           1
%e A332204    2     2    2+i          -1
%e A332204    3     3      3           0
%e A332204    4     4      4           1
%e A332204    5     5    5+i           2
%e A332204    6     5  5+2*i           0
%e A332204    7     6  6+2*i           1
%e A332204    8     7  7+3*i          -1
%e A332204    9     8  8+2*i           0
%e A332204   10     9  9+2*i          -2
%e A332204   11     9    9+i          -1
%e A332204   12    10     10           0
%e A332204   13    11     11           1
%e A332204   14    12   12+i          -1
%e A332204   15    13     13           0
%e A332204   16    14     14           1
%t A332204 A065359[0] = 0;
%t A332204 A065359[n_] := -Total[(-1)^PositionIndex[Reverse[IntegerDigits[n, 2]]][1]];
%t A332204 g[z_] := z/GCD[Re[z], Im[z]];
%t A332204 Module[{n = 0}, Re[NestList[# + g[(1+I)^A065359[n++]] &, 0, 100]]] (* _Paolo Xausa_, Aug 28 2024 *)
%o A332204 (PARI) \\ See Links section.
%Y A332204 Cf. A065359, A096268, A217730, A332205 (imaginary part), A332206 (where f is real).
%K A332204 nonn,base
%O A332204 0,3
%A A332204 _Rémy Sigrist_, Feb 07 2020