This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A340945 #17 May 28 2023 11:25:57 %S A340945 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 A340945 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 A340945 -8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8,-8 %N A340945 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 A340945 Rémy Sigrist, <a href="/A340945/b340945.txt">Table of n, a(n) for n = 0..10101</a> %H A340945 Rémy Sigrist, <a href="/A340945/a340945.gp.txt">PARI program for A340945</a> %H A340945 <a href="/index/Con#coordinates_2D_curves">Index entries for sequences related to coordinates of 2D curves</a> %F A340945 a(n) = 0 iff n = 4*x^2 + 4*x + 1 for some x. %F A340945 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 A340945 The spiral starts as follows: %e A340945 +-----+-----+-----+-----+ %e A340945 |7 6 5 4 |3 . %e A340945 | | . %e A340945 + +-----+-----+ + + %e A340945 |8 | | |2 | %e A340945 | | | | | %e A340945 + + +-----+-----+ + %e A340945 |9 | | |0 1 | %e A340945 | | | | | . %e A340945 + + + +-----+-----+ . %e A340945 |10 | | . %e A340945 | | | . %e A340945 + + +-----+-----+-----+-----+ %e A340945 .11 . %e A340945 . %e A340945 - so a(0) = a(1) = a(9) = 0, %e A340945 a(2) = a(8) = 1, %e A340945 a(3) = a(4) = a(5) = a(6) = a(7) = 2, %e A340945 a(10) = -1, %e A340945 a(11) = -2. %o A340945 (PARI) See Links section. %o A340945 (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 A340945 Cf. A340172, A340944, A000194. %K A340945 sign,easy,look %O A340945 0,4 %A A340945 _Rémy Sigrist_, Jan 30 2021