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 A335816 #19 Jul 10 2020 03:54:57 %S A335816 1,2,3,11,29,13,31,59,33,61,97,139,191,251,193,141,142,143,101,65,37, %T A335816 17,5,19,7,23,47,79,49,25,9,8,6,4,14,15,34,35,62,63,98,99,64,66,67, %U A335816 103,149,201,263,331,409,493,587,586,687,797,689,589,691,591,499,593,501 %N A335816 Squares visited by a chess king moving on a square-spiral numbered board where the king moves to the adjacent unvisited square containing the spiral number with the fewest divisors. In case of a tie it chooses the square with the lowest spiral number. %C A335816 This sequences gives the numbers of the squares visited by a chess king moving on a square-spiral numbered board where the king starts on the 1 numbered square and at each step moves to an adjacent unvisited square, out of the eight adjacent neighboring squares, which contains the number with the fewest divisors. If two or more adjacent squares exist with the same fewest number of divisors then the square with the lowest spiral number is chosen. Note that if the king simply moves to the smallest available number, as the knight does in A316667, the sequence will be infinite as the king will just follow the square spiral path. %C A335816 The sequence is finite. After 411 steps the square with number 760 is visited, after which all adjacent neighboring squares have been visited. %C A335816 Due to the king's preference for squares with the fewest divisors it will move to a prime numbered square when possible, and the lowest prime if two or more unvisited primes are in adjacent squares. Of the 411 visited squares 134 contain prime numbers while 277 contain composites. The largest visited square is a(365) = 3061. %H A335816 Scott R. Shannon, <a href="/A335816/b335816.txt">Table of n, a(n) for n = 1..412</a> %H A335816 Scott R. Shannon, <a href="/A335816/a335816.png">Image showing the 411 steps of the king's path</a>. A green dot marks the starting 1 square and a red dot the final square with number 760. The red dot is surrounded by eight blue dots to show the occupied neighboring squares. A yellow dots marks the smallest unvisited square with number 16. %e A335816 The board is numbered with the square spiral: %e A335816 . %e A335816 17--16--15--14--13 . %e A335816 | | . %e A335816 18 5---4---3 12 29 %e A335816 | | | | | %e A335816 19 6 1---2 11 28 %e A335816 | | | | %e A335816 20 7---8---9--10 27 %e A335816 | | %e A335816 21--22--23--24--25--26 %e A335816 . %e A335816 a(1) = 1, the starting square for the king. %e A335816 a(2) = 2. The eight unvisited squares around a(1) the king can move to are numbered 2,3,4,5,6,7,8,9. Of these 2,3,5,7 have the minimum two divisors, and of those 2 is the smallest. %e A335816 a(4) = 11. The six unvisited squares around a(3) = 3 the king can move to are numbered 4,11,12,13,14,15. Of these 11 and 13 have the minimum two divisors, and of those 11 is the smallest. %Y A335816 Cf. A316667, A330008, A329520, A326922, A328928, A328929. %K A335816 nonn,walk,fini,full %O A335816 1,2 %A A335816 _Scott R. Shannon_, Jun 25 2020