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.
%I A332251 #34 Sep 25 2020 04:14:17 %S A332251 0,1,1,1,0,0,-1,-2,-2,-2,-3,-4,-4,-5,-5,-5,-4,-4,-5,-6,-6,-7,-7,-7,-6, %T A332251 -7,-7,-7,-6,-6,-5,-4,-4,-4,-5,-6,-6,-7,-7,-7,-6,-7,-7,-7,-6,-6,-5,-4, %U A332251 -4,-5,-5,-5,-4,-4,-3,-2,-2,-2,-1,0,0,1,1,1,0,0,-1,-2 %N A332251 a(n) is the real part of f(n) defined by f(0) = 0 and f(n+1) = f(n) + i^A000120(n) (where i denotes the imaginary unit). Sequence A332252 gives imaginary parts. %C A332251 The representation of {f(n)} corresponds to a Lévy C Curve. %H A332251 Rémy Sigrist, <a href="/A332251/b332251.txt">Table of n, a(n) for n = 0..8192</a> %H A332251 Michael Beeler, R. William Gosper, and Richard Schroeppel, <a href="https://dspace.mit.edu/handle/1721.1/6086">HAKMEM</a>, MIT Artificial Intelligence Laboratory report AIM-239, February 1972. Item 135, The "C" Curve, by Gosper, page 65. Also <a href="http://www.inwap.com/pdp10/hbaker/hakmem/flows.html#item135">HTML transcription</a>. %H A332251 Robert Ferréol (MathCurve), <a href="https://www.mathcurve.com/fractals/c/c.shtml">Courbe du C (ou courbe de Lévy)</a> [in French] %H A332251 Paul Lévy, <a href="https://gallica.bnf.fr/ark:/12148/bpt6k57344323/f53.image">Les courbes planes ou gauches et les surfaces composées de parties semblables au tout</a>, Journal de l'École Polytechnique, July 1938 pages 227-247, and <a href="https://gallica.bnf.fr/ark:/12148/bpt6k57344820/f3.image">continued</a> October 1938 pages 249-292. %H A332251 Kevin Ryde, <a href="http://user42.tuxfamily.org/c-curve/index.html">Iterations of the Lévy C Curve</a>, section Coordinates. %H A332251 Rémy Sigrist, <a href="/A332251/a332251.png">Colored representation of f(n) in the complex plane for n = 0..2^20</a> (where the hue is function of n) %H A332251 Rémy Sigrist, <a href="/A332251/a332251_1.png">Representation of f(n) for n=0..32 in the complex plan</a> %H A332251 Wikipedia, <a href="https://en.wikipedia.org/wiki/L%C3%A9vy_C_curve">Lévy C Curve</a> %H A332251 <a href="/index/Con#coordinates_2D_curves">Index entries for sequences related to coordinates of 2D curves</a> %F A332251 For any k >= 0: %F A332251 - a(2^(4*k)) = (-4)^k, %F A332251 - a(2^(4*k+1)) = (-4)^k, %F A332251 - a(2^(4*k+2)) = 0, %F A332251 - a(2^(4*k+3)) = -2*(-4)^k. %F A332251 From _Kevin Ryde_, Sep 24 2020: (Start) %F A332251 With complex b = 1+i, %F A332251 f(2*n) = b*f(n) and f(2*n+1) = f(2*n) + i^A000120(2*n), expand and step. %F A332251 f(2^k + r) = b^k + i*f(r), for 0 <= r < 2^k, replication. %F A332251 f(n) = Sum_{j=0..t} i^j*b^k[j] where binary n = 2^k[0] + ... + 2^k[t] with descending powers k[0] > ... > k[t] >= 0, so change binary to base b with rotating coefficient i^0, i^1, i^2, ... at each 1-bit. %F A332251 (End) %e A332251 The first terms, alongside f(n) and A000120(n), are: %e A332251 n a(n) f(n) A000120(n) %e A332251 -- ---- ------ ---------- %e A332251 0 0 0 0 %e A332251 1 1 1 1 %e A332251 2 1 1+i 1 %e A332251 3 1 1+2*i 2 %e A332251 4 0 2*i 1 %e A332251 5 0 3*i 2 %e A332251 6 -1 -1+3*i 2 %e A332251 7 -2 -2+3*i 3 %e A332251 8 -2 -2+2*i 1 %e A332251 9 -2 -2+3*i 2 %e A332251 10 -3 -3+3*i 2 %e A332251 11 -4 -4+3*i 3 %e A332251 12 -4 -4+2*i 2 %e A332251 13 -5 -5+2*i 3 %e A332251 14 -5 -5+i 3 %e A332251 15 -5 -5 4 %e A332251 16 -4 -4 1 %e A332251 From _Kevin Ryde_, Sep 24 2020: (Start) %e A332251 n = 2^9 + 2^8 + 2^5 + 2^2 + 2^1 = 806 %e A332251 f(n) = 1*b^9 + i*b^8 + i^2*b^5 + i^3*b^2 + i^4*b^1 = 23 + 37*i %e A332251 so a(806) = 23 and A332252(806) = 37. %e A332251 (End) %o A332251 (PARI) { z=0; for (n=0, 67, print1 (real(z) ", "); z += I^hammingweight(n)) } %o A332251 (PARI) a(n) = my(v=binary(n),s=1); for(i=2,#v, if(v[i],v[i]=(s*=I))); real(subst(Pol(v),'x,1+I)); \\ _Kevin Ryde_, Sep 24 2020 %Y A332251 Cf. A332252 (imaginary part), A000120 (segment direction), A179868 (segment direction mod 4). %Y A332251 Cf. A332383 (dragon curve). %K A332251 sign,look,base %O A332251 0,8 %A A332251 _Rémy Sigrist_, Feb 08 2020