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.

A068225 Neighbor in 1-2 direction of numbers arranged as clockwise spiral.

Original entry on oeis.org

2, 11, 12, 3, 4, 1, 8, 9, 10, 27, 28, 29, 30, 13, 14, 15, 16, 5, 6, 7, 22, 23, 24, 25, 26, 51, 52, 53, 54, 55, 56, 31, 32, 33, 34, 35, 36, 17, 18, 19, 20, 21, 44, 45, 46, 47, 48, 49, 50, 83, 84, 85, 86, 87, 88, 89, 90, 57, 58, 59, 60, 61, 62, 63, 64, 37, 38, 39, 40, 41, 42, 43
Offset: 1

Views

Author

Frank Ellermann, Feb 22 2002

Keywords

Examples

			For example, if the spiral is oriented such that 1 is immediately to the right of 2, as shown below, then a(2) = 11 because 11 is immediately to the right of 2.
  21--22--23--24--25--26
  |                    |
  20  7---8---9---10  27
  |   |            |   |
  19  6   1---2   11  28
  |   |       |    |   |
  18  5---4---3   12  29
  |                |   |
  17--16--15--14--13  30
                       |
  36--35--34--33--32--31
		

Crossrefs

Cf. A068226 (inverse, left), A334751 (above), A334752 (below).
Cf. A054552 (middle row right), A054567 (middle row left).

A341542 Numbers on the square spiral board that are enclosed by four primes.

Original entry on oeis.org

12, 72, 1152, 1452, 1950, 3672, 5520, 6660, 8232, 10302, 10890, 13218, 15288, 15360, 16062, 18042, 20898, 21018, 23628, 25998, 27918, 32190, 37812, 42018, 42462, 48858, 55818, 57192, 80832, 80910, 83340, 91368, 97848, 98640, 104472, 111492, 117498, 119550
Offset: 1

Views

Author

Ya-Ping Lu, Feb 13 2021

Keywords

Comments

This sequence is similar to A172294, in which the starting number of the square spiral is 0 instead of 1. For a(n) < 10000000, 4 out of the 782 terms in this sequence, 72, 10302, 415380 and 1624350 are absent in A172294, while 6 out of the 784 terms in A172294, 42, 23562, 83232, 205662, 5805690 and 7019850 are absent in this sequence.
Conjecture: This sequence is infinite. If the conjecture holds, then the twin prime conjecture is true.
The 4 neighbors of n in the spiral are A068225, A068226, A334751, and A334752. - Kevin Ryde, Feb 13 2021

Crossrefs

Programs

  • Python
    from sympy import isprime
    from math import sqrt, ceil
    m, m_max = 2, 1000000
    while m <= m_max:
        L = [0, 0, 0, 0]
        n = int(ceil((sqrt(m) + 1.0)/2.0))
        z1 = 4*n*n - 12*n + 10
        z2 = 4*n*n - 10*n + 7
        z3 = 4*n*n - 8*n + 5
        z4 = 4*n*n - 6*n + 3
        z5 = 4*n*n - 4*n + 1
        if m > z1 and m < z2: L = [m + 1, m - 8*n + 15, m - 1, m + 8*n - 7]
        elif m > z2 and m < z3: L = [m + 8*n - 5, m + 1, m - 8*n + 13, m - 1]
        elif m > z3 and m < z4: L = [m - 1, m + 8*n - 3, m + 1, m - 8*n + 11]
        elif m > z4 and m < z5: L = [m - 8*n + 9, m - 1, m + 8*n - 1, m + 1]
        if isprime(L[0]) == 1 and isprime(L[1]) == 1 and isprime(L[2]) == 1 and isprime(L[3]) == 1: print(m)
        m += 2

A068226 Neighbor in 2-1 direction of numbers arranged as clockwise spiral.

Original entry on oeis.org

6, 1, 4, 5, 18, 19, 20, 7, 8, 9, 2, 3, 14, 15, 16, 17, 38, 39, 40, 41, 42, 21, 22, 23, 24, 25, 10, 11, 12, 13, 32, 33, 34, 35, 36, 37, 66, 67, 68, 69, 70, 71, 72, 43, 44, 45, 46, 47, 48, 49, 26, 27, 28, 29, 30, 31, 58, 59, 60, 61, 62, 63, 64, 65, 102, 103, 104, 105, 106, 107
Offset: 1

Views

Author

Frank Ellermann, Feb 22 2002

Keywords

Comments

Any offset (x,y) in this spiral is a permutation of the natural numbers.

Examples

			For example, if the spiral is oriented such that 1 is immediately to the left of 2, as shown below, then a(1) = 6 because 6 is immediately to the left of 1.
  21--22--23--24--25--26
  |                    |
  20  7---8---9---10  27
  |   |            |   |
  19  6   1---2   11  28
  |   |       |    |   |
  18  5---4---3   12  29
  |                |   |
  17--16--15--14--13  30
                       |
  36--35--34--33--32--31
		

Crossrefs

Cf. A068225 (inverse, right), A334751 (above), A334752 (below).

A334751 a(n) is the number immediately above n in a clockwise square spiral of the positive integers with the first step to the right.

Original entry on oeis.org

8, 9, 2, 1, 6, 7, 22, 23, 24, 25, 10, 11, 12, 3, 4, 5, 18, 19, 20, 21, 44, 45, 46, 47, 48, 49, 26, 27, 28, 29, 30, 13, 14, 15, 16, 17, 38, 39, 40, 41, 42, 43, 74, 75, 76, 77, 78, 79, 80, 81, 50, 51, 52, 53, 54, 55, 56, 31, 32, 33, 34, 35, 36, 37, 66, 67, 68, 69
Offset: 1

Views

Author

Peter Kagey, May 10 2020

Keywords

Comments

Equivalently the number immediately below n in a counterclockwise spiral of the positive integers with the first step to the right.
This is a permutation of the positive integers. A334752 is the inverse permutation.

Examples

			For n = 1, a(1) = 8 because 8 is immediately above one in the clockwise square spiral with first step to the right:
  21--22--23--24--25--26
  |                    |
  20  7---8---9---10  27
  |   |            |   |
  19  6   1---2   11  28
  |   |       |    |   |
  18  5---4---3   12  29
  |                |   |
  17--16--15--14--13  30
                       |
  36--35--34--33--32--31
		

Crossrefs

Cf. A068225 (right), A068226 (left), A334752 (below).
Cf. A174344 (x-coordinate), A268038 (y-coordinate).
Showing 1-4 of 4 results.