login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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.
6
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, 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, -2, -2, -3, -4, -4, -5, -5, -5, -4, -3, -3, -2, -1, 0, 0, 1, 2, 2, 3, 4, 4, 5, 5, 6
OFFSET
0,5
LINKS
Hugo Pfoertner, Plot of mapped spiral, using Plot 2.
PROG
(PARI) \\ ax(n), ay(n) after Kevin Ryde's functions in A174344 and A274923,
\\ p(i, j) given in A307110
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))};
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))};
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};
for (k=0, 81, print1 (p(ax(k), ay(k))[1]", "))
CROSSREFS
A362956 gives the corresponding y-coordinates.
Sequence in context: A365746 A094718 A076191 * A282318 A286971 A025861
KEYWORD
sign
AUTHOR
Hugo Pfoertner, May 10 2023
STATUS
approved