OFFSET
1,3
COMMENTS
The sequence is a permutation of the integers.
LINKS
Hugo Pfoertner, Table of n, a(n) for n = 1..10000
PROG
(PARI) /* It is assumed that the files a305575 and a305576 contain the second column of the corresponding b-files omitting the initial 0 */
a305575=readvec(a305575); a305576=readvec(a305576);
a174344=vector(10000); L=0; d=1; n=0;
for(r=1, 100, d=-d; k=floor(r/2)*d; for(j=1, L++, a174344[n++]=k); forstep(j=k-d, -floor((r+1)/2)*d+d, -d, a174344[n++]=j));
a274923=vector(10100); L=1; d=1; n=0;
for(r=1, 100, d=-d; k=floor(r/2)*d; for(j=1, L++, a274923[n++]=k); forstep(j=k-d, -floor((r+1)/2)*d+d, -d, a274923[n++]=j));
findinring(i, j)={my(s=i*i+j*j); if(s==0, return(0), forstep(k=floor(Pi*(s+1))+sqrtint(s), 1, -1, if(i==a305575[k]&&j==a305576[k], return(k))))};
for(n=1, 67, print1(findinring(a174344[n], a274923[n]), ", "));
CROSSREFS
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, May 11 2019
STATUS
approved