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”).

A326407
Minesweeper sequence of positive integers arranged on a 2D grid along a square array that grows by alternately adding a row at its bottom edge and a column at its right edge.
8
2, -1, -1, 2, -1, 5, -1, 2, 1, 3, -1, 4, -1, 3, 2, 0, -1, 3, -1, 3, 3, 2, -1, 1, 0, 2, 3, 2, -1, 3, -1, 1, 2, 2, 2, 0, -1, 1, 2, 3, -1, 3, -1, 3, 3, 2, -1, 1, 0, 1, 2, 2, -1, 2, 3, 2, 3, 2, -1, 2, -1, 3, 2, 0, 1, 2, -1, 2, 1, 1, -1, 3, -1, 1, 1, 1, 3, 3, -1, 1, 0
OFFSET
1,1
COMMENTS
Place positive integers on a 2D grid starting with 1 in the top left corner and continue along an increasing square array as in A060734.
Replace each prime with -1 and each nonprime with the number of primes in adjacent grid cells around them.
n is replaced by a(n).
This sequence treats prime numbers as "mines" and fills gaps according to the rules of the classic Minesweeper game.
a(n) < 6 (conjectured).
a(n) = 5 for n={6} (conjectured).
Set of n such that a(n) = 4 is unbounded (conjectured).
LINKS
Michael De Vlieger, Minesweeper-style graph read along original mapping, replacing -1 with a "mine", and 0 with blank space.
Michael De Vlieger, Square plot of a million terms read along original mapping, with black indicating a prime and levels of gray commensurate to a(n).
Witold Tatkiewicz, link for Java program
Wikipedia, Minesweeper game
EXAMPLE
Consider positive integers distributed onto the plane along an increasing square array:
1 4 9 16 25 36
2 3 8 15 24 35
5 6 7 14 23 34
10 11 12 13 22 33
17 18 19 20 21 32
26 27 28 29 30 31
...
1 is not prime and in adjacent grid cells there are 2 primes: 2 and 3. Therefore a(1) = 2.
2 is prime, therefore a(2) = -1.
8 is not prime and in adjacent grid cells there are 2 primes: 3, and 7. Therefore a(8) = 2.
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:
2 2 1 . . . . . . . . . ...
* * 2 2 1 2 1 2 1 1 . 1
* 5 * 3 * 2 * 3 * 2 1 1
3 * 4 * 2 2 2 * 3 * 1 1
* 3 * 3 3 1 3 2 3 1 2 1
2 3 2 * 3 * 3 * 1 . 1 *
* 1 2 3 * 3 * 2 1 . 2 3
1 2 2 * 2 3 2 3 1 2 2 *
1 2 * 2 1 1 * 3 * 2 * 2
2 * 3 2 . 2 3 * 3 3 1 1
* 3 * 1 1 2 * 3 * 2 1 .
1 2 1 2 2 * 3 3 2 * 1 1
...
In order to produce the sequence, the graph is read along the original mapping.
MATHEMATICA
Block[{n = 12, s}, s = ArrayPad[Array[If[#1 < 2 #2 - 1, #2^2 + #2 - #1, (#1 - #2)^2 + #2] & @@ {#1 + #2 - 1, #2} &, {# + 1, # + 1}], 1] &@ n; Table[If[PrimeQ@ m, -1, Count[#, _?PrimeQ] &@ Union@ Map[s[[#1, #2]] & @@ # &, Join @@ Array[FirstPosition[s, m] + {##} - 2 &, {3, 3}]]], {m, PolygonalNumber@ n}]] (* Michael De Vlieger, Oct 02 2019 *)
PROG
(Java) See Links section.
CROSSREFS
Cf. A060734 - plane mapping
Different arrangements of integers:
Cf. A326405 - antidiagonals,
Cf. A326406 - triangle maze,
Cf. A326408 - square maze,
Cf. A326409 - Hamiltonian path,
Cf. A326410 - Ulam's spiral.
Sequence in context: A117008 A337366 A153917 * A126127 A230324 A060256
KEYWORD
sign,tabl
AUTHOR
Witold Tatkiewicz, Oct 02 2019
STATUS
approved