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-4 of 4 results.

A163364 Inverse permutation to A163363.

Original entry on oeis.org

1, 3, 5, 2, 4, 7, 12, 8, 13, 18, 25, 19, 14, 9, 6, 10, 15, 20, 27, 21, 28, 36, 44, 35, 43, 53, 63, 52, 42, 34, 26, 33, 41, 50, 61, 51, 62, 74, 86, 73, 85, 99, 113, 98, 84, 72, 60, 71, 59, 48, 39, 49, 40, 32, 24, 31, 23, 17, 11, 16, 22, 30, 38, 29, 37, 46, 57, 47, 58, 70, 82
Offset: 1

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Crossrefs

Inverse: A163363.

Formula

a(n) = A163360(n-1) + 1.

A163359 Hilbert curve in N x N grid, starting downwards from the top-left corner, listed by descending antidiagonals.

Original entry on oeis.org

0, 3, 1, 4, 2, 14, 5, 7, 13, 15, 58, 6, 8, 12, 16, 59, 57, 9, 11, 17, 19, 60, 56, 54, 10, 30, 18, 20, 63, 61, 55, 53, 31, 29, 23, 21, 64, 62, 50, 52, 32, 28, 24, 22, 234, 65, 67, 49, 51, 33, 35, 27, 25, 233, 235, 78, 66, 68, 48, 46, 34, 36, 26, 230, 232, 236, 79, 77, 71
Offset: 0

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Examples

			The top left 8x8 corner of the array shows how this surjective self-avoiding walk begins (connect the terms in numerical order, 0-1-2-3-...):
   +0 +3 +4 +5 58 59 60 63
   +1 +2 +7 +6 57 56 61 62
   14 13 +8 +9 54 55 50 49
   15 12 11 10 53 52 51 48
   16 17 30 31 32 33 46 47
   19 18 29 28 35 34 45 44
   20 23 24 27 36 39 40 43
   21 22 25 26 37 38 41 42
		

Crossrefs

Transpose: A163357, a(n) = A163357(A061579(n)). Inverse: A163360. One-based version: A163363. Row sums: A163365. Row 0: A163483. Column 0: A163482. Central diagonal: A062880.
See also A163334 and A163336 for the Peano curve.

Programs

  • Mathematica
    b[{n_, k_}, {m_}] := (A[n, k] = m-1);
    MapIndexed[b, List @@ HilbertCurve[4][[1]]];
    Table[A[n-k, k], {n, 0, 12}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Mar 07 2021 *)

A163361 Hilbert curve in N x N grid, one-based, starting rightwards from the top-left corner.

Original entry on oeis.org

1, 2, 4, 15, 3, 5, 16, 14, 8, 6, 17, 13, 9, 7, 59, 20, 18, 12, 10, 58, 60, 21, 19, 31, 11, 55, 57, 61, 22, 24, 30, 32, 54, 56, 62, 64, 235, 23, 25, 29, 33, 53, 51, 63, 65, 236, 234, 26, 28, 36, 34, 52, 50, 68, 66, 237, 233, 231, 27, 37, 35, 47, 49, 69, 67, 79, 240, 238, 232
Offset: 1

Views

Author

Antti Karttunen, Jul 29 2009

Keywords

Crossrefs

Inverse: A163362. Transpose: A163363.

Formula

a(n) = A163357(n-1)+1

A326409 Minesweeper sequence of positive integers arranged on a 2D grid along Hamiltonian path.

Original entry on oeis.org

2, -1, -1, 3, -1, 3, -1, 3, 4, 2, -1, 3, -1, 3, 3, 2, -1, 4, -1, 2, 2, 1, -1, 2, 3, 1, 1, 2, -1, 3, -1, 3, 3, 2, 3, 2, -1, 1, 2, 2, -1, 2, -1, 2, 2, 2, -1, 1, 1, 0, 1, 2, -1, 2, 3, 1, 2, 2, -1, 2, -1, 1, 1, 1, 1, 2, -1, 1, 2, 1, -1, 3, -1, 2, 2, 1, 2, 3, -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 top left corner and continue along Hamiltonian path A163361 or A163363.
Replace each prime with -1 and each nonprime by 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 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 an increasing Hamiltonian path (in this case it starts downwards):
.
   1   4---5---6  59--60--61  64--...
   |   |       |   |       |   |
   2---3   8---7  58--57  62--63
           |           |
  15--14   9--10  55--56  51--50
   |   |       |   |       |   |
  16  13--12--11  54--53--52  49
   |                           |
  17--18  31--32--33--34  47--48
       |   |           |   |
  20--19  30--29  36--35  46--45
   |           |   |           |
  21  24--25  28  37  40--41  44
   |   |   |   |   |   |   |   |
  22--23  26--27  38--39  42--43
.
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 3 primes: 5, 3 and 7. 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   3---*---3   *---2---*   1 ...
  |   |       |   |       |   |
  *---*   3---*   2---2   1---1
          |           |
  3---3   4---2   3---1   1---.
  |   |       |   |       |   |
  2   *---3---*   2---*---2   1
  |                           |
  *---4   *---3---3---2   *---1
      |   |           |   |
  2---*   3---*   2---3   2---2
  |           |   |           |
  2   2---3   2   *   2---*   2
  |   |   |   |   |   |   |   |
  1---*   1---1   1---2   2---*
In order to produce the sequence, the graph is read along its original mapping.
		

Crossrefs

Cf. A163361 (plane mapping), A163363 (alternative plane mapping).
Different arrangements of integers: A326405 (antidiagonals), A326406 (triangle maze), A326407 (square mapping), A326408 (square maze), A326410 (Ulam's spiral).

Programs

  • Mathematica
    Block[{nn = 4, s, t, u}, s = ConstantArray[0, {2^#, 2^#}] &[nn + 1]; t = First[HilbertCurve@ # /. Line -> List] &[nn + 1] &[nn + 1]; s = ArrayPad[ReplacePart[s, Array[{1, 1} + t[[#]] -> # &, 2^(2 (nn + 1))]], {{1, 0}, {1, 0}}]; u = Table[If[PrimeQ@ m, -1, Count[#, _?PrimeQ] &@ Union@ Map[s[[#1, #2]] & @@ # &, Join @@ Array[FirstPosition[s, m] + {##} - 2 &, {3, 3}]]], {m, (2^nn)^2}]]
Showing 1-4 of 4 results.