login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
To begin, 1 is placed at square (x,y) = (0,0); this then becomes square s = 1. Integers are added sequentially to the open squares of the neighborhood around square s. The neighborhood of a square is defined as: east (x+1,y), south (x,y-1), west (x-1,y), and north (x,y+1). The order in which numbers may be added to a neighborhood is always east, south, west, then north.
Numbers are added to open squares in the neighborhood of square s following the given order. The next number added to the grid is always the smallest positive integer not yet present on the grid. If a filled square is encountered within the current square's neighborhood, the process moves to the next direction in the order. Once the process has cycled through all directions of the neighborhood of a given square s, the process is repeated at square s+1.
The filled grid is then read as a clockwise square spiral, oriented east starting at (0,0). a(n) is the n-th term along the square spiral.
Since each positive integer is added to the grid once, reading the grid as a spiral gives a permutation of the positive integers. Similar permutations can be created by expanding the neighborhood of s.
LINKS
John Tyler Rascoe, Python program
EXAMPLE
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
PROG
(Python) # see linked program
CROSSREFS
Sequence in context: A340711 A242304 A227415 * A309156 A298042 A051430
KEYWORD
nonn,easy
AUTHOR
John Tyler Rascoe, Mar 04 2023
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 28 07:46 EDT 2024. Contains 372020 sequences. (Running on oeis4.)