OFFSET
0,10
LINKS
Rainer Rosenthal, Table of n, a(n) for n = 0..3000
Hugo Pfoertner, Plot of mapped spiral, using Plot 2.
Hugo Pfoertner, Visualization of spiral, (orange) and bijection partners from the 2 grids.
Hugo Pfoertner, Comparison of the spirals. This sequence: black, A362955: red.
PROG
\\ It is assumed that the PARI program from A367150 has been loaded and the functions defined there are available.
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))};
a367895(n) = BijectionD([ax(n), ay(n)])[1]
CROSSREFS
KEYWORD
sign
AUTHOR
Hugo Pfoertner and Rainer Rosenthal, Dec 04 2023
STATUS
approved