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 A362955 #19 Aug 24 2025 05:51:59 %S A362955 0,1,0,-1,-2,-1,0,1,2,2,1,1,0,0,-1,-2,-3,-2,-1,-1,0,0,1,2,3,4,3,2,2,1, %T A362955 0,-1,-1,-2,-3,-3,-4,-4,-3,-2,-2,-1,0,1,1,2,3,3,4,5,4,3,3,2,1,0,0,-1, %U A362955 -2,-2,-3,-4,-4,-5,-5,-5,-4,-3,-3,-2,-1,0,0,1,2,2,3,4,4,5,5,6 %N A362955 a(n) is the x-coordinate of the n-th point in a square spiral mapped to a square grid rotated by Pi/4 using the distance-limited strip bijection described in A307110. %H A362955 Hugo Pfoertner, <a href="/A362955/b362955.txt">Table of n, a(n) for n = 0..3000</a> %H A362955 Hugo Pfoertner, <a href="https://oeis.org/plot2a?name1=A362955&name2=A362956&tform1=untransformed&tform2=untransformed&shift=0&radiop1=xy&drawlines=true">Plot of mapped spiral</a>, using Plot 2. %o A362955 (PARI) \\ ax(n), ay(n) after Kevin Ryde's functions in A174344 and A274923, %o A362955 \\ p(i,j) given in A307110 %o A362955 ax(n) = {my(m=sqrtint(n), k=ceil(m/2)); n -= 4*k^2; if(n<0, if(n<-m, k, -k-n), if(n<m, -k, n-3*k))}; %o A362955 ay(n) = {my(m=sqrtint(n), k=ceil(m/2)); n -= 4*k^2; if(n<0, if(n<-m, 3*k+n, k), if(n<m, k-n, -k))}; %o A362955 p(i, j) = {my(C=cos(Pi/8), S=sin(Pi/8), T=S/C, gx=i*C-j*S, gy=i*S+j*C, k, xm, ym, v=[0, 0]); k=round(gy/C); ym=C*k; xm=gx+(gy-ym)*T; v[1]=round((xm-ym*T)*C); v[2]=round((ym+v[1]*S)/C); v}; %o A362955 for (k=0, 81, print1 (p(ax(k),ay(k))[1]", ")) %Y A362955 A362956 gives the corresponding y-coordinates. %Y A362955 Cf. A174344, A274923, A307110, A307731, A367150, A367895, A367896. %K A362955 sign,changed %O A362955 0,5 %A A362955 _Hugo Pfoertner_, May 10 2023