login
A368122
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 symmetrized variant of the distance-limited strip bijection described in A368121.
2
0, 1, 0, -1, -1, -1, 0, 1, 1, 2, 2, 1, 0, 0, -1, -2, -3, -2, -2, -1, 0, 0, 1, 2, 3, 3, 3, 2, 2, 1, 0, -1, -2, -2, -3, -3, -4, -3, -3, -2, -2, -1, 0, 1, 2, 2, 3, 3, 4, 5, 4, 4, 3, 2, 1, 1, 0, 0, -1, -2, -3, -4, -4, -5, -6, -5, -4, -4, -3, -2, -1, -1, 0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 5, 5, 5, 4
OFFSET
0,10
PROG
(PARI) \\ ax(n), ay(n) after Kevin Ryde's functions in A174344 and A274923.
\\ It is assumed that the PARI programs from A367150 and A368121 have 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))};
a368122(n) = BijectionD([ax(n), ay(n)], BijectionK)[1];
CROSSREFS
A368123 gives the corresponding y-coordinates.
Analogous pair of sequences, but without symmetrization: A367895, A367896.
Sequence in context: A051168 A367895 A368127 * A281459 A163528 A329054
KEYWORD
sign
AUTHOR
Hugo Pfoertner, Jan 06 2024
STATUS
approved