cp's OEIS Frontend

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.

A348672 The numbers visited on a square spiral when stepping to the closest unvisited number such that the sum of that number and the current number is prime. If two or more such numbers exist then the smallest is chosen.

This page as a plain text file.
%I A348672 #11 Oct 30 2021 13:50:25
%S A348672 1,2,3,4,15,14,33,34,13,30,29,12,11,8,9,10,27,26,47,24,23,6,5,18,19,
%T A348672 40,39,68,69,70,43,108,71,42,41,20,21,22,7,46,25,48,49,52,51,50,81,82,
%U A348672 169,168,221,222,167,164,117,116,77,114,113,44,45,112,111,158,159,214,277,280,351,350,281
%N A348672 The numbers visited on a square spiral when stepping to the closest unvisited number such that the sum of that number and the current number is prime. If two or more such numbers exist then the smallest is chosen.
%C A348672 The path taken by the visited numbers approaches the spiral origin numerous times via unvisited squares for larger values of n. See the linked image. After 1 million steps the smallest unvisited number is 196, although it is possible this and similar smaller numbers are eventually visited for very large n.
%H A348672 Scott R. Shannon, <a href="/A348672/a348672.gif">Image of the path after 500000 steps</a>. The colors are graduated across the spectrum to show the relative step order. Notice how the violet colored path, representing visited numbers after about 450000 steps, approaches the origin, marked with a white dot, via previously unvisited numbers.
%e A348672 The square spiral is numbered as follows:
%e A348672 .
%e A348672   17--16--15--14--13   .
%e A348672    |               |   .
%e A348672   18   5---4---3  12  29
%e A348672    |   |       |   |   |
%e A348672   19   6   1---2  11  28
%e A348672    |   |           |   |
%e A348672   20   7---8---9--10  27
%e A348672    |                   |
%e A348672   21--22--23--24--25--26
%e A348672 .
%e A348672 a(2) = 2 as the three closest neighbors to 1 which when added to 1 form a prime are 2,4 and 6. Of those 2 is the smallest.
%e A348672 a(9) = 13 as the twelve closest numbers to 34 have either been visited or form a composite when added to 34. The closest and smallest unvisited number which forms a prime when added to 34 is 13.
%Y A348672 Cf. A348673 (add to composite), A332767, A338642, A000040.
%K A348672 nonn
%O A348672 1,2
%A A348672 _Scott R. Shannon_, Oct 29 2021