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.

A326405 Minesweeper sequence of positive integers arranged on a 2D grid along ascending antidiagonals.

This page as a plain text file.
%I A326405 #41 Feb 28 2020 02:07:34
%S A326405 3,-1,-1,3,-1,2,-1,4,4,0,-1,4,-1,2,0,3,-1,3,-1,1,0,2,-1,3,3,1,1,0,-1,
%T A326405 3,-1,2,2,1,2,0,-1,3,3,2,-1,2,-1,2,0,2,-1,2,3,2,3,2,-1,1,0,1,2,2,-1,3,
%U A326405 -1,2,2,1,1,0,-1,1,1,3,-1,3,-1,1,2,1,2,0
%N A326405 Minesweeper sequence of positive integers arranged on a 2D grid along ascending antidiagonals.
%C A326405 Map the positive integers on a 2D grid starting with 1 in top left corner and continue along increasing antidiagonals.
%C A326405 Replace each prime with -1 and each nonprime with the number of primes in adjacent grid cells around it.
%C A326405 If n is the original number, a(n) is the number that replaces it.
%C A326405 This sequence treats prime numbers as "mines" and fills gaps according to the rules of the classic Minesweeper game.
%C A326405 a(n) < 5 (conjectured).
%C A326405 Set of n such that a(n) = 4 is unbounded (conjectured).
%H A326405 Michael De Vlieger, <a href="/A326405/b326405.txt">Table of n, a(n) for n = 1..11325</a> (150 antidiagonals).
%H A326405 Michael De Vlieger, <a href="/A326405/a326405.png">Minesweeper-style graph</a> read along original mapping, replacing -1 with a "mine", and 0 with blank space.
%H A326405 Michael De Vlieger, <a href="/A326405/a326405_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 A326405 Witold Tatkiewicz, <a href="https://pastebin.com/pTPNEuzd">link for Java program</a>
%H A326405 Wikipedia, <a href="https://en.wikipedia.org/wiki/Minesweeper_(video_game)">Minesweeper game</a>
%e A326405 Consider positive integers distributed on the plane along antidiagonals:
%e A326405    1  2  4  7 11 16 ...
%e A326405    3  5  8 12 17 ...
%e A326405    6  9 13 18 ...
%e A326405   10 14 19 ...
%e A326405   15 20 ...
%e A326405   21 ...
%e A326405   ...
%e A326405 1 is not prime and in its adjacent grid cells there are 3 primes: 2, 3 and 5. Therefore a(1) = 3.
%e A326405 2 is prime, therefore a(2) = -1.
%e A326405 8 is not prime and in adjacent grid cells there are 4 primes: 2, 5, 7 and 13. Therefore a(8) = 4.
%e A326405 From _Michael De Vlieger_, Oct 01 2019: (Start)
%e A326405 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 A326405   3  *  3  *  *  3  2  *  *  2  1  * ...
%e A326405   *  *  4  4  *  *  3  3  *  2  1  2
%e A326405   2  4  *  3  3  *  3  2  2  1  1  1
%e A326405   .  2  *  3  2  2  3  *  3  1  1  *
%e A326405   .  1  1  2  *  2  3  *  *  2  1  1
%e A326405   .  1  1  2  3  *  3  3  *  3  1  .
%e A326405   .  2  *  2  2  *  3  2  3  *  2  1
%e A326405   .  2  *  2  1  1  2  *  2  1  3  *
%e A326405   .  1  1  2  1  1  1  2  3  2  3  *
%e A326405   .  1  1  2  *  2  1  1  *  *  2  2
%e A326405   .  2  *  3  2  *  1  1  2  2  1  1
%e A326405   .  2  *  3  2  2  1  1  1  1  .  1
%e A326405    ...  (End)
%t A326405 Block[{n = 12, s}, s = ArrayPad[Array[1 + PolygonalNumber[#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_, Sep 30 2019 *)
%o A326405 (Java) See Links section.
%Y A326405 Different arrangements of integers:
%Y A326405 Cf. A326406 - triangle maze,
%Y A326405 Cf. A326407 - square mapping,
%Y A326405 Cf. A326408 - square maze,
%Y A326405 Cf. A326409 - Hamiltonian path,
%Y A326405 Cf. A326410 - Ulam's spiral.
%K A326405 sign,tabl
%O A326405 1,1
%A A326405 _Witold Tatkiewicz_, Sep 26 2019