cp's OEIS Frontend

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.

A268038 List of y-coordinates of point moving in clockwise square spiral.

This page as a plain text file.
%I A268038 #27 Aug 17 2018 21:09:17
%S A268038 0,0,-1,-1,-1,0,1,1,1,1,0,-1,-2,-2,-2,-2,-2,-1,0,1,2,2,2,2,2,2,1,0,-1,
%T A268038 -2,-3,-3,-3,-3,-3,-3,-3,-2,-1,0,1,2,3,3,3,3,3,3,3,3,2,1,0,-1,-2,-3,
%U A268038 -4,-4,-4,-4,-4,-4,-4,-4,-4,-3,-2,-1,0,1,2,3,4,4,4
%N A268038 List of y-coordinates of point moving in clockwise square spiral.
%C A268038 This spiral, in either direction, is sometimes called the "Ulam spiral", but "square spiral" is a better name. (Ulam looked at the positions of the primes, but of course the spiral itself must be much older.) - _N. J. A. Sloane_, Jul 17 2018
%H A268038 Peter Kagey, <a href="/A268038/b268038.txt">Table of n, a(n) for n = 1..10000</a>
%H A268038 <a href="https://oeis.org/plot2a?name1=A174344&amp;name2=A268038&amp;tform1=untransformed&amp;tform2=untransformed&amp;shift=0&amp;radiop1=xy&amp;drawlines=true">Visualization of spiral using Plot 2.</a> - _Hugo Pfoertner_, May 29 2018
%e A268038 Sequence gives y-coordinate of the n-th point of the following spiral:
%e A268038 .
%e A268038   20--21--22--23--24--25
%e A268038    |                   |
%e A268038   19   6---7---8---9  26
%e A268038    |   |           |   |
%e A268038   18   5   0---1  10  27
%e A268038    |   |       |   |   |
%e A268038   17   4---3---2  11  28
%e A268038    |               |   |
%e A268038   16--15--14--13--12  29
%e A268038                        |
%e A268038   35--34--33--32--31--30
%t A268038 a[n_] := a[n] = If[n==0, 0, a[n-1] + Cos[Mod[Floor[Sqrt[4*(n-1) + 1]], 4]* Pi/2]];
%t A268038 Table[a[n], {n, 0, 100}] (* _Jean-François Alcover_, Jun 11 2018, after _Seppo Mustonen_ *)
%o A268038 (PARI)  L=1; d=-1;
%o A268038 for(r=1,9,d=-d;k=floor(r/2)*d;for(j=1,L++,print1(k,", "));forstep(j=k-d,-floor((r+1)/2)*d+d,-d,print1(j,", "))) \\ _Hugo Pfoertner_, Jul 28 2018
%Y A268038 A174344 gives sequence of x-coordinates.
%Y A268038 This is the negative of A274923.
%Y A268038 The (x,y) coordinates for a point sweeping a quadrant by antidiagonals are (A025581, A002262). - _N. J. A. Sloane_, Jul 17 2018
%K A268038 sign,easy
%O A268038 1,13
%A A268038 _Peter Kagey_, Jan 24 2016