%I #26 Feb 28 2020 02:08:04
%S 3,-1,-1,2,-1,3,-1,4,4,1,-1,3,-1,3,2,1,-1,3,-1,3,2,1,-1,2,3,2,3,1,-1,
%T 3,-1,2,2,1,2,1,-1,2,3,1,-1,3,-1,3,2,1,-1,2,3,2,3,2,-1,2,1,0,1,2,-1,3,
%U -1,2,2,1,2,1,-1,2,2,1,-1,3,-1,3,4,0,1,1
%N Minesweeper sequence of positive integers arranged on a 2D grid along a triangular maze.
%C Write positive integers on a 2D grid starting with 1 in the top left corner and continue along the triangular maze as in A056023.
%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 (conjectured).
%C Set of n such that a(n) = 4 is unbounded (conjectured).
%H Michael De Vlieger, <a href="/A326406/b326406.txt">Table of n, a(n) for n = 1..11325</a> (150 antidiagonals).
%H Michael De Vlieger, <a href="/A326406/a326406.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="/A326406/a326406_1.png">Square plot of a million terms</a> read along original mapping, with black indicating a prime and levels of gray commensurate to a(n).
%H Witold Tatkiewicz, <a href="https://pastebin.com/1auXQnuZ">link for Java program</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Minesweeper_(video_game)">Minesweeper game</a>
%e Consider positive integers placed on the plane along a triangular maze:
%e 1 2 6 7 15 16 ...
%e 3 5 8 14 17 ...
%e 4 9 13 18 ...
%e 10 12 19 ...
%e 11 20 ...
%e 21 ...
%e ...
%e 1 is not prime and in adjacent grid cells there are 3 primes: 2, 3 and 5. Therefore a(1) = 3.
%e 2 is prime, therefore a(2) = -1.
%e 8 is not prime and in adjacent grid cells there are 4 primes: 2, 5, 7 and 13. Therefore a(8) = 4.
%e Replacing n by 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 3 * 3 * 2 1 1 * 2 1 1 * ...
%e * * 4 3 * 3 3 3 * 2 2 2
%e 2 4 * 3 2 * * 2 1 2 * 1
%e 1 3 * 3 2 3 3 2 1 1 1 2
%e * 3 2 2 * 2 2 * 2 1 . 1
%e 2 * 1 1 3 * 3 2 * 2 1 1
%e 1 2 3 2 3 * 3 2 3 * 1 .
%e 1 2 * * 3 2 2 * 2 1 2 2
%e * 2 2 4 * 2 1 2 3 2 2 *
%e 1 1 . 2 * 3 1 1 * * 2 3
%e . 1 2 3 3 * 2 2 3 2 1 1
%e 1 2 * * 2 1 2 * 1 . . 1
%e ...
%e In order to produce sequence graph is read along original mapping.
%t 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 *)
%o (Java) See Links section.
%Y Cf. A056023 - plane mapping
%Y Different arrangements of integers:
%Y Cf. A326405 - antidiagonals,
%Y Cf. A326407 - square mapping,
%Y Cf. A326408 - square maze,
%Y Cf. A326409 - Hamiltonian path,
%Y Cf. A326410 - Ulam's spiral.
%K sign,tabl
%O 1,1
%A _Witold Tatkiewicz_, Oct 02 2019
|