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 A336446 #11 Jul 25 2020 09:51:29 %S A336446 1,2,3,5,7,19,17,13,11,23,47,43,41,37,31,29,53,127,79,73,71,67,103, %T A336446 101,97,61,59,131,89,83,173,167,163,157,151,107,109,271,211,199,197, %U A336446 193,191,139,137,239,181,179,641,457,241,251,257,263,149,397,389,313,311,307,293,113,281 %N A336446 Squares visited by a chess queen moving on a square-spiral numbered board where the queen moves to an unvisited square containing the smallest prime number. %C A336446 This sequences gives the numbers of the squares visited by a chess queen moving on a square-spiral numbered board where the queen starts on the 1 numbered square and at each step moves to an unvisited square containing the smallest prime number. The movement is restricted to the eight directions a queen can move on a standard chess board, and the queen cannot move over a previously visited square. Note that if the queen simply moves to an unvisited square containing the smallest number the sequence will be infinite as the queen will just follow the square spiral path. %C A336446 The sequence is finite. After 5880 steps the square with number 55903 is visited, after which all eight squares the queen can move to have been visited. %C A336446 The first term where this sequence differs from A336402, where the queen steps to the closest unvisited prime, is a(4) = 5. See the examples below. %C A336446 The largest visited square is a(4943) = 79187. The largest step distance between visited squares is 72 units, between a(3205) = 31397 to a(3206) = 31469. The largest prime gap between visited squares is 30150, from a(4942) = 49037 to a(4943) = 79187. The smallest unvisited prime is 45833. %H A336446 Scott R. Shannon, <a href="/A336446/a336446.png">Image showing the 5880 steps of the queen's path</a>. A green square shows the starting 1 square, a red square, above the bottom-left corner, shows the final square with number 55903, and a thick white line is the path between visited squares. All visited prime numbered squares are shown in yellow, while those unvisited squares containing primes are shown in grey. The eight squares which block the queen's movement from the final square are shown with a red border. The square spiral numbering of the board is shown as a thin white line. Click on the image to zoom in to see the prime numbers. %e A336446 The board is numbered with the square spiral: %e A336446 . %e A336446 17--16--15--14--13 . %e A336446 | | . %e A336446 18 5---4---3 12 29 %e A336446 | | | | | %e A336446 19 6 1---2 11 28 %e A336446 | | | | %e A336446 20 7---8---9--10 27 %e A336446 | | %e A336446 21--22--23--24--25--26 %e A336446 . %e A336446 a(1) = 1, the starting square for the queen. %e A336446 a(2) = 2. The seven unvisited prime numbered squares around a(1) the queen can move to are numbered 2,3,61,5,19,7,23. Of these 2 is the smallest. There are no primes in the south-east direction from a(1). %e A336446 a(4) = 5. The four unvisited prime numbered squares around a(3) = 3 the queen can move to are numbered 11,29,13,5, the other two available directions not having any primes. Of these 5 is the smallest. Note that 11 is the closest prime, being only sqrt(2) units away while 5 is 2 units away. %e A336446 a(4943) = 79187. This is only unvisited square containing a prime number around a(4942) = 49037. It is 30 units away to the right. %Y A336446 Cf. A336402, A336413, A336447, A330979, A000040, A063826, A214664, A214665, A136626, A115258, A331027. %K A336446 nonn,walk,fini,full %O A336446 1,2 %A A336446 _Scott R. Shannon_, Jul 22 2020