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.

A305258 List of y-coordinates of a point moving in a smooth counterclockwise spiral rotated by Pi/4.

Original entry on oeis.org

0, 0, 1, 0, -1, -1, 0, 1, 2, 1, 0, -1, -2, -2, -1, 0, 1, 2, 3, 2, 1, 0, -1, -2, -3, -3, -2, -1, 0, 1, 2, 3, 4, 3, 2, 1, 0, -1, -2, -3, -4, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3
Offset: 0

Views

Author

Hugo Pfoertner, May 29 2018

Keywords

Examples

			Sequence gives y-coordinate of the n-th point of the following spiral:
   d:
   4 |                  32  49
     |                 /   \   \
   3 |              33  18  31  48
     |             /   /   \   \   \
   2 |          34  19   8  17  30  47
     |         /   /   /   \   \   \   \
   1 |      35  20   9   2   7  16  29  46
     |     /   /   /   /   \   \   \   \   \
   0 |  36  21  10   3   0---1   6  15  28  45
     |     \   \   \   \       /   /   /   /
  -1 |      37  22  11   4---5  14  27  44
     |         \   \   \      /    /   /
  -2 |          38  23  12--13  26  43
     |             \   \       /   /
  -3 |              39  24--25  42
     |                 \       /
  -4 |                  40--41
       _______________________________________
  x:    -4  -3  -2  -1   0   1   2   3   4   5
		

Crossrefs

A010751 gives sequence of x-coordinates.
Cf. A053616.

Programs

  • PARI
    up=-1;print1(x=0,", ");for(stride=1,12,up=-up;x+=stride;y=x+stride+1;for(k=x,y-1,print1(up*min(k-x,y-k), ", "))) \\ Hugo Pfoertner, Jun 02 2018

Formula

a(n) = A053616(n)*sign(sin(Pi*(1+sqrt(1+8*n))/2)), so that abs(a(n)) = A053616(n).
a(n) = A010751(n-floor((1/2)*(sqrt(2n-1)+1))). - William McCarty, Jul 29 2021