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 A336336 #23 Jun 25 2021 21:20:10 %S A336336 0,1,2,1,2,1,2,1,2,5,4,5,8,5,4,5,8,5,4,5,8,5,4,5,8,13,10,9,10,13,18, %T A336336 13,10,9,10,13,18,13,10,9,10,13,18,13,10,9,10,13,18,25,20,17,16,17,20, %U A336336 25,32,25,20,17,16,17,20,25,32,25,20,17,16,17,20,25,32 %N A336336 Squared distance from start of a point moving in a square spiral. %C A336336 The terms corresponding to the corner points of the spiral with a(k-1) < a(k) > a(k+1), i.e., 2, 2, 2, 5, 8, 8, 8, 13, 18, 18, 18, ... are given by the sequence A001105(1) repeated 3 times, (A001105(1)+A001105(2))/2, A001105(2) repeated 3 times, (A001105(2)+A001105(3))/2, A001105(3) repeated 3 times, ... . %C A336336 These numbers are the norms of the Gaussian integers discussed in A345436. - _N. J. A. Sloane_, Jun 25 2021 %H A336336 Hugo Pfoertner, <a href="/A336336/b336336.txt">Table of n, a(n) for n = 1..10000</a> %H A336336 N. J. A. Sloane, <a href="/A336336/a336336.pdf">Sketch showing first 49 cells (numbered in black, starting at 0) of the square spiral and the corresponding squared distances from the origin (red).</a> (This illustration assumes the sequence has offset 0.) %F A336336 a(n) = A174344(n)^2 + A268038(n)^2 = A174344(n)^2 + A274923(n)^2. %o A336336 (PARI) A336336(m)={my(v=vectorsmall(m));for(Lstart=0,1,my(L=Lstart,d=1,n=0);for(r=1,oo,d=-d;my(k=floor(r/2)*d); for(j=1,L++,n++;if(n<=m,v[n]+=k*k));forstep(j=k-d,-floor((r+1)/2)*d+d,-d,n++;if(n<=m,v[n]+=j*j));if(n>m,break)));v}; %o A336336 A336336(73) %Y A336336 Cf. A001105, A174344, A268038, A274923, A335298. %Y A336336 See also A345436. %K A336336 nonn %O A336336 1,3 %A A336336 _Hugo Pfoertner_, Jul 18 2020