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.

A338644 Square spiral of smallest distinct positive integers starting at 1 such that the four sums of each term with its four nearest neighbors is a prime number.

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 5, 12, 11, 8, 9, 10, 13, 16, 15, 22, 19, 24, 17, 14, 23, 18, 25, 36, 35, 26, 21, 20, 27, 34, 33, 28, 31, 52, 37, 42, 29, 54, 43, 30, 53, 44, 39, 50, 89, 48, 61, 66, 41, 32, 47, 62, 51, 46, 55, 76, 63, 38, 45, 58, 49, 60, 67, 72, 59, 68, 83, 84, 73, 78, 95, 98, 65, 74, 57, 92
Offset: 1

Views

Author

Scott R. Shannon and Eric Angelini, Apr 21 2021

Keywords

Examples

			The square spiral starts:
.
     29--42--37--52--31--28--33
      |                       |
     54  19--22--15--16--13  34
      |   |               |   |
     43  24   7---4---3  10  27
      |   |   |       |   |   |
     30  17   6   1---2   9  20
      |   |   |           |   |
     53  14   5--12--11---8  21
      |   |                   |
     44  23--18--25--36--35--26
      |
     39--50--89--48--61--66--41..
.
a(2) = 2 as a(1) + 2 = 1 + 2 = 3, the smallest possible prime number.
a(3) = 3 as a(2) + 3 = 2 + 3 = 5, the next smallest possible prime number.
a(5) = 7 as a(4) + 7 = 4 + 7 = 11. Note a(5) cannot be 5 or 6 as when these are added to 4 the result is a composite number.
a(9) = 11 as a(8) + 11 = 12 + 11 = 23, and a(2) + 11 = 2 + 11 = 13, both being prime.
		

Crossrefs

Cf. A338642 (sum to composites), A000040, A063826, A260643, A334742, A307834, A338221.