A359058 a(n) = squared distance to the origin of the n-th vertex on a counterclockwise undulating spiral in a square grid.
0, 1, 2, 1, 4, 5, 2, 5, 4, 1, 2, 1, 4, 5, 2, 5, 4, 9, 10, 5, 8, 5, 10, 9, 16, 17, 10, 13, 8, 13, 10, 17, 16, 9, 10, 5, 8, 5, 10, 9, 16, 17, 10, 13, 8, 13, 10, 17, 16, 25, 26, 17, 20, 13, 18, 13, 20, 17, 26, 25, 36, 37, 26, 29, 20, 25, 18, 25, 20, 29, 26, 37, 36, 25, 26, 17, 20, 13, 18, 13, 20
Offset: 0
Examples
The spiral begins as follows and for instance point n=7 is at x=-2,y=1 so that a(7) = (-2)^2 + 1^2 = 5. y ^ | 4 | 17--16 | | | 3 | 13--10 9--10 | | | 2 | 13---8 5---4 5---8 | | | | | 1 | 17--10 5---2 1---2 5--10 | | | | | 0 | 16---9 4---1 0---1 4---9 | | | | | -1 | 10---5 2---1 2---5 10--17 | | | | | -2 | 8---5 4---5 8--13 | | | -3 | 10---9 10--13 | | | -4 | 16--17 +------------------------------------> -4 -3 -2 -1 0 1 2 3 4 x
Links
- Rémy Sigrist, Table of n, a(n) for n = 0..10081
- Hans G. Oberlack, Undulating counterclockwise spiral in a square grid
- Rémy Sigrist, PARI program
Programs
-
PARI
See Links section.
Comments