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.
%I A361207 #45 Jul 10 2023 01:40:00 %S A361207 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, %T A361207 28,14,27,45,67,47,31,19,34,53,76,54,36,22,38,58,82,59,40,25,32,48,68, %U A361207 92,66,44,26,43,65,91,121,93,69,49,33,52,75,102,133,103,77 %N 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. %C A361207 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. %C A361207 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. %C A361207 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. %C A361207 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. %H A361207 John Tyler Rascoe, <a href="/A361207/b361207.txt">Table of n, a(n) for n = 1..10000</a> %H A361207 John Tyler Rascoe, <a href="/A361207/a361207_1.txt">Python program</a> %H A361207 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %e A361207 The spiral begins: %e A361207 . %e A361207 41 %e A361207 . %e A361207 40 25 32 %e A361207 . %e A361207 39--24--13--18--30 %e A361207 . | %e A361207 38 23 12---5-- 8--16 28 %e A361207 . | | | %e A361207 37 22 11 4 1---2 6 14 26 %e A361207 . | | | | %e A361207 36 21 10---3---7 15 27 %e A361207 . | | %e A361207 35--20---9--17--29 %e A361207 . %e A361207 34 19 31 %e A361207 . %e A361207 33 %o A361207 (Python) # see linked program %Y A361207 Cf. A090915, A217010, A337822. %K A361207 nonn,easy %O A361207 1,2 %A A361207 _John Tyler Rascoe_, Mar 04 2023