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”).

List of Y-coordinates of point moving along one of the arms of a counterclockwise square spiral with four arms; A340944 gives X-coordinates.
3

%I #17 May 28 2023 11:25:57

%S 0,0,1,2,2,2,2,2,1,0,-1,-2,-3,-4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-2,-1,0,1,

%T 2,3,4,5,6,6,6,6,6,6,6,6,6,6,6,6,6,5,4,3,2,1,0,-1,-2,-3,-4,-5,-6,-7,

%U -8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8

%N List of Y-coordinates of point moving along one of the arms of a counterclockwise square spiral with four arms; A340944 gives X-coordinates.

%H Rémy Sigrist, <a href="/A340945/b340945.txt">Table of n, a(n) for n = 0..10101</a>

%H Rémy Sigrist, <a href="/A340945/a340945.gp.txt">PARI program for A340945</a>

%H <a href="/index/Con#coordinates_2D_curves">Index entries for sequences related to coordinates of 2D curves</a>

%F a(n) = 0 iff n = 4*x^2 + 4*x + 1 for some x.

%F a(n) = Im z where z = (r-s*i)*i^s with s = round(sqrt(n)) = A000194(n) and remainder r = n - s^2. - _Kevin Ryde_, May 28 2023

%e The spiral starts as follows:

%e +-----+-----+-----+-----+

%e |7 6 5 4 |3 .

%e | | .

%e + +-----+-----+ + +

%e |8 | | |2 |

%e | | | | |

%e + + +-----+-----+ +

%e |9 | | |0 1 |

%e | | | | | .

%e + + + +-----+-----+ .

%e |10 | | .

%e | | | .

%e + + +-----+-----+-----+-----+

%e .11 .

%e .

%e - so a(0) = a(1) = a(9) = 0,

%e a(2) = a(8) = 1,

%e a(3) = a(4) = a(5) = a(6) = a(7) = 2,

%e a(10) = -1,

%e a(11) = -2.

%o (PARI) See Links section.

%o (PARI) a(n) = my(r,s=sqrtint(n,&r)); if(r>s, s++;r-=2*s-1); imag((r-s*I)*I^s); \\ _Kevin Ryde_, May 28 2023

%Y Cf. A340172, A340944, A000194.

%K sign,easy,look

%O 0,4

%A _Rémy Sigrist_, Jan 30 2021