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.

Showing 1-6 of 6 results.

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.

Original entry on oeis.org

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

Views

Author

Witold Tatkiewicz, Oct 02 2019

Keywords

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

Examples

			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.
		

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.

Programs

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

Original entry on oeis.org

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, 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, -1, 2, 2, 1, 1, 0, -1, 1, 1, 3, -1, 3, -1, 1, 2, 1, 2, 0
Offset: 1

Views

Author

Witold Tatkiewicz, Sep 26 2019

Keywords

Comments

Map the positive integers on a 2D grid starting with 1 in top left corner and continue along increasing antidiagonals.
Replace each prime with -1 and each nonprime with the number of primes in adjacent grid cells around it.
If n is the original number, a(n) is the number that replaces it.
This sequence treats prime numbers as "mines" and fills gaps according to the rules of the classic Minesweeper game.
a(n) < 5 (conjectured).
Set of n such that a(n) = 4 is unbounded (conjectured).

Examples

			Consider positive integers distributed on the plane along antidiagonals:
   1  2  4  7 11 16 ...
   3  5  8 12 17 ...
   6  9 13 18 ...
  10 14 19 ...
  15 20 ...
  21 ...
  ...
1 is not prime and in its adjacent grid cells there are 3 primes: 2, 3 and 5. Therefore a(1) = 3.
2 is prime, therefore a(2) = -1.
8 is not prime and in adjacent grid cells there are 4 primes: 2, 5, 7 and 13. Therefore a(8) = 4.
From _Michael De Vlieger_, Oct 01 2019: (Start)
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:
  3  *  3  *  *  3  2  *  *  2  1  * ...
  *  *  4  4  *  *  3  3  *  2  1  2
  2  4  *  3  3  *  3  2  2  1  1  1
  .  2  *  3  2  2  3  *  3  1  1  *
  .  1  1  2  *  2  3  *  *  2  1  1
  .  1  1  2  3  *  3  3  *  3  1  .
  .  2  *  2  2  *  3  2  3  *  2  1
  .  2  *  2  1  1  2  *  2  1  3  *
  .  1  1  2  1  1  1  2  3  2  3  *
  .  1  1  2  *  2  1  1  *  *  2  2
  .  2  *  3  2  *  1  1  2  2  1  1
  .  2  *  3  2  2  1  1  1  1  .  1
   ...  (End)
		

Crossrefs

Different arrangements of integers:
Cf. A326406 - triangle maze,
Cf. A326407 - square mapping,
Cf. A326408 - square maze,
Cf. A326409 - Hamiltonian path,
Cf. A326410 - Ulam's spiral.

Programs

A326406 Minesweeper sequence of positive integers arranged on a 2D grid along a triangular maze.

Original entry on oeis.org

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, 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, -1, 2, 2, 1, 2, 1, -1, 2, 2, 1, -1, 3, -1, 3, 4, 0, 1, 1
Offset: 1

Views

Author

Witold Tatkiewicz, Oct 02 2019

Keywords

Comments

Write positive integers on a 2D grid starting with 1 in the top left corner and continue along the triangular maze as in A056023.
Replace each prime with -1 and each nonprime with the number of primes in adjacent grid cells around it.
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) < 5 (conjectured).
Set of n such that a(n) = 4 is unbounded (conjectured).

Examples

			Consider positive integers placed on the plane along a triangular maze:
   1  2  6  7 15 16 ...
   3  5  8 14 17 ...
   4  9 13 18 ...
  10 12 19 ...
  11 20 ...
  21 ...
  ...
1 is not prime and in adjacent grid cells there are 3 primes: 2, 3 and 5. Therefore a(1) = 3.
2 is prime, therefore a(2) = -1.
8 is not prime and in adjacent grid cells there are 4 primes: 2, 5, 7 and 13. Therefore a(8) = 4.
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:
  3  *  3  *  2  1  1  *  2  1  1  * ...
  *  *  4  3  *  3  3  3  *  2  2  2
  2  4  *  3  2  *  *  2  1  2  *  1
  1  3  *  3  2  3  3  2  1  1  1  2
  *  3  2  2  *  2  2  *  2  1  .  1
  2  *  1  1  3  *  3  2  *  2  1  1
  1  2  3  2  3  *  3  2  3  *  1  .
  1  2  *  *  3  2  2  *  2  1  2  2
  *  2  2  4  *  2  1  2  3  2  2  *
  1  1  .  2  *  3  1  1  *  *  2  3
  .  1  2  3  3  *  2  2  3  2  1  1
  1  2  *  *  2  1  2  *  1  .  .  1
...
In order to produce sequence graph is read along original mapping.
		

Crossrefs

Cf. A056023 - plane mapping
Different arrangements of integers:
Cf. A326405 - antidiagonals,
Cf. A326407 - square mapping,
Cf. A326408 - square maze,
Cf. A326409 - Hamiltonian path,
Cf. A326410 - Ulam's spiral.

Programs

A326408 Minesweeper sequence of positive integers arranged on a 2D grid along a square maze.

Original entry on oeis.org

2, -1, -1, 3, -1, 3, -1, 4, 3, 1, -1, 4, -1, 3, 4, 2, -1, 2, -1, 2, 3, 3, -1, 2, 1, 0, 2, 3, -1, 2, -1, 2, 2, 1, 3, 2, -1, 1, 1, 2, -1, 4, -1, 2, 3, 3, -1, 1, 0, 0, 2, 3, -1, 1, 1, 1, 3, 3, -1, 3, -1, 2, 2, 1, 0, 1, -1, 3, 3, 2, -1, 2, -1, 2, 1, 0, 1, 2, -1, 2, 1
Offset: 1

Views

Author

Witold Tatkiewicz, Oct 04 2019

Keywords

Comments

Place positive integers on 2D grid starting with 1 in the top left corner and continue along the square maze as in A081344.
Replace each prime with -1 and each nonprime with the number of primes in adjacent grid cells around it.
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) < 5.
Set of n such that a(n) = 4 is unbounded (conjectured).

Examples

			Consider positive integers distributed onto the plane along increasing square array:
   1  4  5 16 17 36 ...
   2  3  6 15 18 35
   9  8  7 14 19 34
  10 11 12 13 20 33
  25 24 23 22 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 4 primes: 2, 3, 7 and 11. Therefore a(8) = 4.
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  3  *  2  *  2  *  1  .  1  *  1 ...
  *  *  3  4  2  3  1  2  1  3  2  2
  3  4  *  3  *  1  1  2  *  3  *  1
  1  *  4  *  2  2  2  *  3  *  2  2
  1  2  *  3  3  2  *  3  3  1  2  2
  .  2  3  *  2  *  4  *  2  2  2  *
  .  1  *  3  3  2  *  3  *  2  *  4
  .  2  3  *  1  1  1  3  2  4  3  *
  1  2  *  2  1  .  1  2  *  2  *  2
  1  *  2  1  .  .  1  *  3  3  1  1
  1  1  1  .  1  1  2  2  *  2  1  .
  .  1  1  1  1  *  2  2  2  *  1  1
...
In order to produce the sequence, the graph is read along its original mapping.
		

Crossrefs

Cf. A081344 - plane mapping
Different arrangements of integers:
Cf. A326405 - antidiagonals,
Cf. A326406 - triangle maze,
Cf. A326407 - square mapping,
Cf. A326409 - Hamiltonian path,
Cf. A326410 - Ulam's spiral.

Programs

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

Original entry on oeis.org

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, 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, -1, 2, 2, 1, 3, 3, -1, 1, 2, 3, -1, 4, -1, 3, 2, 0, 1, 2, -1, 1, 1
Offset: 1

Views

Author

Witold Tatkiewicz, Oct 07 2019

Keywords

Comments

Place positive integers on a 2D grid starting with 1 in the center and continue along a spiral.
Replace each prime with -1 and each nonprime with the number of primes in adjacent grid cells around it.
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) = 5 for n = 12.
Set of n such that a(n) = 4 is unbounded (conjecture).

Examples

			Consider positive integers distributed onto the plane along the square spiral:
.
  37--36--35--34--33--32--31
   |                       |
  38  17--16--15--14--13  30
   |   |               |   |
  39  18   5---4---3  12  29
   |   |   |       |   |   |
  40  19   6   1---2  11  28
   |   |   |           |   |
  41  20   7---8---9--10  27
   |   |                   |
  42  21--22--23--24--25--26
   |
  43--44--45--46--47--48--49--...
.
1 is not prime and in adjacent grid cells there are 4 primes: 2, 3, 5 and 7. Therefore a(1) = 4.
2 is prime, therefore a(2) = -1.
8 is not prime and in adjacent grid cells there are 4 primes: 2, 7 and 23. Therefore a(8) = 3.
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---3---3---*
  |                       |
  3   *---2---2---2---*   3
  |   |               |   |
  3   3   *---3---*   5   *
  |   |   |       |   |   |
  2   *   3   4---*   *   3
  |   |   |           |   |
  *   3   *---3---3---2   2
  |   |                   |
  3   3---2---*---2---1---.
  |
  *---1---1---2---*---2---1---...
In order to produce the sequence, the graph is read along the square spiral.
		

Crossrefs

Cf. A136626 - similar sequence: For every number n in Ulam's spiral the sequence gives the number of primes around it (number n excluded).
Cf. A136627 - similar sequence: For every number n in Ulam's spiral the sequence gives the number of primes around it (number n included).
Different arrangements of integers:
Cf. A326405 (antidiagonals), A326406 (triangle maze), A326407 (square mapping), A326408 (square maze), A326409 (Hamiltonian path).

A327893 Minesweeper sequence of positive integers arranged in a hexagonal spiral.

Original entry on oeis.org

4, -1, -1, 3, -1, 3, -1, 3, 2, 4, -1, 3, -1, 3, 2, 2, -1, 3, -1, 2, 0, 2, -1, 3, 1, 2, 2, 2, -1, 2, -1, 1, 1, 1, 2, 3, -1, 2, 0, 1, -1, 4, -1, 1, 1, 2, -1, 1, 0, 1, 2, 3, -1, 3, 1, 0, 0, 1, -1, 4, -1, 1, 0, 0, 1, 3, -1, 2, 2, 2, -1, 2, -1, 3, 1, 1, 0, 1, -1, 3
Offset: 1

Views

Author

Michael De Vlieger, Oct 09 2019

Keywords

Comments

Place positive integers on a 2D grid starting with 1 in the center and continue along a hexagonal spiral. Replace each prime with -1 and each nonprime with the number of primes in adjacent grid cells around it. 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.
The largest term in the sequence is 4 since 1 is surrounded by 3 odd numbers {3, 5, 7} and the only even prime. Additionally, the pattern of odd and even numbers appears in alternating rows oriented in a triangular symmetry such that no other number has more than four odd numbers. (This courtesy of Witold Tatkiewicz.)

Examples

			Consider a spiral grid drawn counterclockwise with the largest number k = A003219(n) = 3*n*(n+1)+1 in "shell" n, and each shell has A008458(n) elements:
          28--27--26--25
          /             \
        29  13--12--11  24
        /   /         \   \
      30  14   4---3  10  23
      /   /   /     \   \   \
    31  15   5   1---2   9  22
      \   \   \         /   /
      32  16   6---7---8  21
        \   \             /
        33  17--18--19--20  ...
          \                /
          34--35--36--37--38
1 is not prime and in the 6 adjacent cells 2 through 7 inclusive, we have 4 primes, therefore a(1) = 4.
2 is prime therefore a(2) = -1.
4 is not prime and in the 6 adjacent cells {1, 3, 12, 13, 14, 5} there are 4 primes, therefore a(4) = 4, etc.
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---2---1
        /             \
       *   *---3---*   3
      /   /         \   \
     2   3   3---*   4   *
    /   /   /     \   \   \
   *   2   *   4---*   2   2
    \   \   \         /   /
     1   3   3---*---3   .
      \   \             /
       1   *---3---*---2  ...
        \                 /
         1---2---3---*---2
		

Crossrefs

Programs

  • Mathematica
    Block[{n = 6, m, s, t, u}, m = n + 1; s = Array[3 #1 (#1 - 1) + 1 + #2 #1 + #3 & @@ {#3, #4, Which[Mod[#4, 3] == 0, Abs[#1], Mod[#4, 3] == 1, Abs[#2], True, Abs[#2] - Abs[#1]]} & @@ {#1, #2, If[UnsameQ @@ Sign[{#1, #2}], Abs[#1] + Abs[#2], Max[Abs[{#1, #2}]]], Which[And[#1 > 0, #2 <= 0], 0, And[#1 >= #2, #1 + #2 > 0], 1, And[#2 > #1, #1 >= 0], 2, And[#1 < 0, #2 >= 0], 3, And[#1 <= #2, #1 + #2 < 0], 4, And[#1 > #2, #1 + #2 <= 0], 5, True, 0]} & @@ {#2 - m - 1, m - #1 + 1} &, {#, #}] &[2 m + 1]; t = s /. k_ /; k > 3 n (n + 1) + 1 :> -k; Table[If[PrimeQ@ m, -1, Count[#, _?PrimeQ] &@ Union@ Map[t[[#1, #2]] & @@ # &, Join @@ Array[FirstPosition[t, m] + {##} - 2 & @@ {#1, #2 + Boole[#1 == #2 == 2] + Boole[#1 == 1]} &, {3, 2}]]], {m, 3 n (n - 1) + 1}]]
Showing 1-6 of 6 results.