OFFSET
0,5
LINKS
Hugo Pfoertner, Table of n, a(n) for n = 0..3000
Hugo Pfoertner, Plot of mapped spiral, using Plot 2.
PROG
\\ 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
KEYWORD
sign
AUTHOR
Hugo Pfoertner, May 10 2023
STATUS
approved