A361207 An infinite 2d grid is filled with the positive integers by placing them clockwise around the lowest number with open neighbors. a(n) is then the n-th term when the grid is read as a clockwise square spiral.
1, 2, 7, 3, 10, 4, 12, 5, 8, 16, 6, 15, 29, 17, 9, 20, 35, 21, 11, 23, 39, 24, 13, 18, 30, 46, 28, 14, 27, 45, 67, 47, 31, 19, 34, 53, 76, 54, 36, 22, 38, 58, 82, 59, 40, 25, 32, 48, 68, 92, 66, 44, 26, 43, 65, 91, 121, 93, 69, 49, 33, 52, 75, 102, 133, 103, 77
Offset: 1
Examples
The spiral begins: . 41 . 40 25 32 . 39--24--13--18--30 . | 38 23 12---5-- 8--16 28 . | | | 37 22 11 4 1---2 6 14 26 . | | | | 36 21 10---3---7 15 27 . | | 35--20---9--17--29 . 34 19 31 . 33
Links
- John Tyler Rascoe, Table of n, a(n) for n = 1..10000
- John Tyler Rascoe, Python program
- Index entries for sequences that are permutations of the natural numbers
Programs
-
Python
# see linked program
Comments