login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Minesweeper sequence of positive integers arranged on a square spiral on a 2D grid.
7

%I #20 Mar 20 2020 23:36:57

%S 4,-1,-1,3,-1,3,-1,3,3,2,-1,5,-1,2,2,2,-1,3,-1,3,3,2,-1,2,1,0,2,3,-1,

%T 3,-1,3,3,1,2,2,-1,3,3,2,-1,3,-1,1,1,2,-1,2,1,1,1,1,-1,2,3,2,2,2,-1,2,

%U -1,2,2,1,3,3,-1,1,2,3,-1,4,-1,3,2,0,1,2,-1,1,1

%N Minesweeper sequence of positive integers arranged on a square spiral on a 2D grid.

%C Place positive integers on a 2D grid starting with 1 in the center and continue along a spiral.

%C Replace each prime with -1 and each nonprime with the number of primes in adjacent grid cells around it.

%C n is replaced by a(n).

%C This sequence treats prime numbers as "mines" and fills gaps according to the rules of the classic Minesweeper game.

%C a(n) = 5 for n = 12.

%C Set of n such that a(n) = 4 is unbounded (conjecture).

%H Michael De Vlieger, <a href="/A326410/b326410.txt">Table of n, a(n) for n = 1..10201</a> (51 spiral iterations).

%H Michael De Vlieger, <a href="/A326410/a326410.png">Minesweeper-style graph</a> read along original mapping, replacing -1 with a "mine", and 0 with blank space.

%H Michael De Vlieger, <a href="/A326410/a326410_1.png">Square plot of 10^3 spiral iterations</a> read along original mapping, with black indicating a prime and levels of gray commensurate to a(n).

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Minesweeper_(video_game)">Minesweeper game</a>

%e Consider positive integers distributed onto the plane along the square spiral:

%e .

%e 37--36--35--34--33--32--31

%e | |

%e 38 17--16--15--14--13 30

%e | | | |

%e 39 18 5---4---3 12 29

%e | | | | | |

%e 40 19 6 1---2 11 28

%e | | | | |

%e 41 20 7---8---9--10 27

%e | | |

%e 42 21--22--23--24--25--26

%e |

%e 43--44--45--46--47--48--49--...

%e .

%e 1 is not prime and in adjacent grid cells there are 4 primes: 2, 3, 5 and 7. Therefore a(1) = 4.

%e 2 is prime, therefore a(2) = -1.

%e 8 is not prime and in adjacent grid cells there are 4 primes: 2, 7 and 23. Therefore a(8) = 3.

%e Replacing n with a(n) in the plane described above, and using "." for a(n) = 0 and "*" for negative a(n), we produce a graph resembling Minesweeper, where the mines are situated at prime n:

%e *---2---2---1---3---3---*

%e | |

%e 3 *---2---2---2---* 3

%e | | | |

%e 3 3 *---3---* 5 *

%e | | | | | |

%e 2 * 3 4---* * 3

%e | | | | |

%e * 3 *---3---3---2 2

%e | | |

%e 3 3---2---*---2---1---.

%e |

%e *---1---1---2---*---2---1---...

%e In order to produce the sequence, the graph is read along the square spiral.

%Y Cf. A136626 - similar sequence: For every number n in Ulam's spiral the sequence gives the number of primes around it (number n excluded).

%Y Cf. A136627 - similar sequence: For every number n in Ulam's spiral the sequence gives the number of primes around it (number n included).

%Y Different arrangements of integers:

%Y Cf. A326405 (antidiagonals), A326406 (triangle maze), A326407 (square mapping), A326408 (square maze), A326409 (Hamiltonian path).

%K sign,tabl

%O 1,1

%A _Witold Tatkiewicz_, Oct 07 2019