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-10 of 11 results. Next

A334742 Pascal's spiral: starting with a(1) = 1, proceed in a square spiral, computing each term as the sum of horizontally and vertically adjacent prior terms.

Original entry on oeis.org

1, 1, 1, 2, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 10, 12, 12, 14, 17, 20, 20, 23, 27, 32, 37, 37, 42, 48, 55, 62, 62, 69, 77, 87, 99, 111, 111, 123, 137, 154, 174, 194, 194, 214, 237, 264, 296, 333, 370, 370, 407, 449, 497, 552, 614, 676, 676, 738, 807, 884, 971, 1070
Offset: 1

Views

Author

Alec Jones and Peter Kagey, May 09 2020

Keywords

Comments

This is the square spiral analogy of Pascal's triangle thought of as a table read by antidiagonals.

Examples

			Spiral begins:
  111--99--87--77--69--62
                        |
   12--12--10---8---7  62
    |               |   |
   14   2---2---1   7  55
    |   |       |   |   |
   17   3   1---1   6  48
    |   |           |   |
   20   3---4---5---5  42
    |                   |
   20--23--27--32--37--37
a(15) = 10 = 8 + 2, the sum of the cells immediately to the right and below. The term to the left is not included in the sum because it has not yet occurred in the spiral.
		

Crossrefs

x- and y-coordinates are given by A174344 and A274923, respectively.

Formula

a(A033638(n)) = a(A002620(n)) for n > 1.

A355270 Lexicographically earliest sequence of positive integers on a square spiral such that the sum of adjacent pairs of numbers within each row, column and diagonal is distinct in that row, column and diagonal.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 2, 4, 3, 3, 4, 4, 3, 5, 4, 2, 4, 3, 5, 4, 4, 2, 3, 6, 4, 6, 5, 7, 6, 2, 6, 3, 2, 5, 8, 4, 3, 6, 6, 7, 3, 5, 7, 6, 8, 8, 7, 1, 2, 7, 5, 1, 2, 5, 8, 6, 4, 8, 5, 6, 9, 7, 1, 4, 10, 1, 1, 6, 3, 9, 12, 5, 1, 7, 2, 1, 6, 4, 1, 13, 6, 4, 7, 9, 12, 10, 7, 11, 1, 5, 2, 10, 7, 4, 5, 8
Offset: 1

Views

Author

Scott R. Shannon, Jun 26 2022

Keywords

Comments

In the first 2 million terms the largest number is 1959, while the number 1, the most commonly occurring number, appears 10893 times. See the linked images.

Examples

			The spiral begins:
.
                                .
    4---8---5---2---3---6---2   :
    |                       |   :
    3   2---4---5---3---4   6   5
    |   |               |   |   |
    6   4   2---1---1   4   7   2
    |   |   |       |   |   |   |
    6   3   2   1---1   3   5   1
    |   |   |           |   |   |
    7   5   3---2---4---3   6   5
    |   |                   |   |
    3   4---4---2---3---6---4   7
    |                           |
    5---7---6---8---8---7---1---2
.
a(25) = 6 as when a(25) is placed, at coordinate (2,-2) relative to the starting square, its adjacent squares are a(10) = 3, a(9) = 4, a(24) = 3. The sums of adjacent pairs of numbers in a(25)'s column are 3 + 3 = 6, 3 + 4 = 7, 4 + 4 = 8, in its northwest diagonal are 4 + 1 = 5, 1 + 2 = 3, 2 + 2 = 4, and in its row are 3 + 2 = 5, 2 + 4 = 6, 4 + 4 = 8. Setting a(25) to 1 would create a sum of 5 with its diagonal neighbor 4, but 5 has already occurred as a sum on this diagonal. Similarly numbers 2, 3, 4 and 5 can be eliminated as they create sums with the three adjacent numbers, 3, 4, and 3, which have already occurred along the corresponding column, diagonal or row. This leaves 6 as the smallest number which creates new sums, namely 9, 10 and 9, with its three neighbors that have not already occurred along the corresponding column, diagonal and row.
		

Crossrefs

A355271 Lexicographically earliest sequence of positive integers on a square spiral such that the product of adjacent pairs of numbers within each row, column and diagonal is distinct in that row, column and diagonal.

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 3, 2, 4, 3, 3, 4, 2, 3, 4, 4, 5, 3, 2, 5, 4, 3, 5, 4, 2, 2, 3, 5, 2, 2, 4, 2, 3, 5, 4, 6, 3, 1, 1, 5, 5, 4, 1, 1, 6, 6, 2, 5, 6, 4, 5, 1, 1, 6, 4, 7, 5, 4, 1, 5, 3, 6, 2, 3, 1, 1, 3, 7, 6, 2, 7, 4, 5, 7, 3, 6, 1, 1, 4, 3, 1, 5, 2, 1, 1, 6, 5, 7, 1, 5, 3, 3, 5, 1, 1, 3, 7, 4, 6
Offset: 1

Views

Author

Scott R. Shannon, Jun 26 2022

Keywords

Comments

In the first 2 million terms the largest number is 257, while the number 37, the most commonly occurring number, appears 43477 times. Prime numbers appear more often than the composites. See the linked images.

Examples

			The spiral begins:
.
                                .
    3---6---4---5---3---2---4   :
    |                       |   :
    1   5---4---4---3---2   2   4
    |   |               |   |   |
    1   3   2---1---1   4   2   6
    |   |   |       |   |   |   |
    5   2   2   1---1   3   5   1
    |   |   |           |   |   |
    5   5   3---2---4---3   3   1
    |   |                   |   |
    4   4---3---5---4---2---2   5
    |                           |
    1---1---6---6---2---5---6---4
.
a(25) = 2 as when a(25) is placed, at coordinate (2,-2) relative to the starting square, its adjacent squares are a(10) = 3, a(9) = 4, a(24) = 4. The products of adjacent pairs of numbers in a(25)'s column are 3 * 3 = 9, 3 * 4 = 12, 4 * 2 = 8, in its north-west diagonal are 4 * 1 = 4, 1 * 2 = 2, 2 * 5 = 10, and in its row are 4 * 5 = 20, 5 * 3 = 15, 3 * 4 = 12. Setting a(25) to 1 would create a product of 4 with its diagonal neighbor 4, but 4 has already occurred as a product on this diagonal. Similarly numbers 3, 4 and 5 would not be possible as they would create products with the three adjacent numbers, 3, 4, and 4, which have already occurred along the corresponding column, diagonal or row. But 2 is smaller and creates new products, namely 6, 8 and 8, with its three neighbors that have not already occurred along the corresponding column, diagonal and row.
		

Crossrefs

A334741 Fill an infinite square array by following a spiral around the origin; in the central cell enter a(0)=1; thereafter, in the n-th cell, enter the sum of the entries of those earlier cells that are in the same row or column as that cell.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 8, 11, 21, 40, 47, 93, 180, 203, 397, 796, 1576, 1675, 3305, 6636, 13192, 14004, 27607, 55029, 110192, 220024, 226740, 450123, 898661, 1798700, 3594248, 3704800, 7354303, 14681369, 29349536, 58710640, 117394896, 119196748, 237492079
Offset: 0

Views

Author

Alec Jones and Peter Kagey, May 09 2020

Keywords

Comments

The spiral track being used here is the same as in A274640, except that the starting cell here is indexed 0 (as in A274641).
The central cell gets index 0 (and we fill it in with the value a(0)=1).

Examples

			Spiral begins:
     3----2----1
     |         |
     5    1----1   47
     |              |
     8---11---21---40
a(11) = 47 = 1 + 1 + 5 + 40, the sum of the cells in its row and column.
		

Crossrefs

Cf. A280027.
x- and y-coordinates are given by A174344 and A274923, respectively.

Programs

  • PARI
    \\ here P(n) returns A174344 and A274923 as pair.
    P(n)={my(m=sqrtint(n), k=ceil(m/2)); n -= 4*k^2; if(n<0, if(n<-m, [k, 3*k+n], [-k-n, k]), if(nAndrew Howroyd, May 09 2020

A338642 Square spiral of smallest distinct positive integers starting at 1 such that the four sums of each term with its four nearest neighbors are composite numbers.

Original entry on oeis.org

1, 3, 5, 7, 2, 8, 4, 11, 9, 6, 12, 10, 14, 13, 15, 18, 16, 19, 17, 21, 23, 22, 24, 25, 20, 26, 28, 27, 29, 31, 32, 30, 33, 35, 34, 36, 38, 39, 37, 40, 41, 43, 42, 45, 46, 44, 47, 48, 50, 49, 51, 53, 55, 56, 54, 52, 58, 59, 57, 60, 61, 62, 63, 66, 64, 68, 65, 67, 71, 69, 72, 70, 73, 74, 76, 77, 75
Offset: 1

Views

Author

Eric Angelini and Scott R. Shannon, Apr 21 2021

Keywords

Examples

			The square spiral starts:
.
     38--36--34--35--33--30--32
      |                       |
     39  16--18--15--13--14  31
      |   |               |   |
     37  19   2---7---5  10  29
      |   |   |       |   |   |
     40  17   8   1---3  12  27
      |   |   |           |   |
     41  21   4--11---9---6  28
      |   |                   |
     43  23--22--24--25--20--26
      |
     42--45--46--44--47--48--50..
.
a(2) = 3 as a(1) + 3 = 1 + 3 = 4, the smallest possible composite number.
a(3) = 5 as a(2) + 5 = 3 + 5 = 8. Note a(3) cannot be 2 or 4 as when these are added to 3 the result is a prime number.
a(4) = 7 as a(3) + 7 = 5 + 7 = 12, and a(1) + 7 = 1 + 7 = 8, both being composite.
a(9) = 9 as a(8) + 9 = 11 + 9 = 20, and a(2) + 9 = 3 + 9 = 12, both being composite.
		

Crossrefs

Cf. A338644 (sum to primes), A002808, A063826, A260643, A334742, A307834, A338221.

A307838 Counterclockwise square spiral constructed by greedy algorithm such that the product of the values of any two vertically or horizontally adjacent cells is unique.

Original entry on oeis.org

1, 1, 2, 3, 3, 4, 2, 5, 7, 2, 11, 8, 3, 9, 5, 10, 2, 13, 7, 16, 3, 17, 5, 8, 18, 3, 19, 4, 13, 11, 5, 14, 7, 12, 8, 23, 1, 29, 5, 15, 8, 22, 5, 23, 4, 18, 17, 6, 26, 5, 27, 6, 25, 9, 11, 19, 1, 31, 9, 17, 11, 20, 7, 21, 8, 37, 3, 41, 11, 24, 9, 35, 6, 34, 10
Offset: 0

Views

Author

Rémy Sigrist, May 01 2019

Keywords

Comments

This sequence is a two-dimensional variant of A088177.
Visually, we have a superposition of two images that we can separate by considering the parity of the sum of the x and y coordinates (see illustrations in Links section).

Examples

			The spiral begins:
    7---19---16---29---14---22---13---43----3---47----2
    |                                                 |
   31    8---21----7---20---11---17----9---31----1   43
    |    |                                       |    |
    2   37    1---23----8---12----7---14----5   19   14
    |    |    |                             |    |    |
   53    3   29    2---10----5----9----3   11   11   14
    |    |    |    |                   |    |    |    |
    4   41    5   13    3----3----2    8   13    9   21
    |    |    |    |    |         |    |    |    |    |
   37   11   15    7    4    1----1   11    4   25   11
    |    |    |    |    |              |    |    |    |
   10   24    8   16    2----5----7----2   19    6   31
    |    |    |    |                        |    |    |
   19    9   22    3---17----5----8---18----3   27   10
    |    |    |                                  |    |
   12   35    5---23----4---18---17----6---26----5   25
    |    |                                            |
   23    6---34---10---29---13----1---41----7---36----8
    |
    9---29----8---26---12---25---49----8---32---10---43
		

Crossrefs

See A307834 for the additive variant.
Cf. A088177.

Programs

  • PARI
    See Links section.

A357985 Counterclockwise square spiral constructed using the integers so that a(n) plus all other numbers currently visible from the current number equals n; start with a(0) = 0.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 3, -1, 6, -2, -1, 0, 1, 9, -8, 15, -5, -7, -10, 14, -29, 58, -78, 101, -118, 150, -61, 309, -307, 553, -494, -186, -644, 315, -1177, 731, -1458, 3480, -5183, 7096, -8328, 9735, -10882, 7200, -29452, 31322, -52670, 51401, -65210, 61001, 11318, 135012, -109687, 259226, -221542
Offset: 0

Views

Author

Scott R. Shannon, Oct 23 2022

Keywords

Comments

A number is visible from the current number if, given that it has coordinates (x,y) relative to the current number, the greatest common divisor of |x| and |y| is 1.
The magnitude of the numbers grow surprisingly quickly, e.g., a(150) = -4346232663618226. The only known terms that equal zero are a(0) and a(11); it is unknown whether more exist or if all integers eventually appear.

Examples

			The spiral begins:
.
                                 .
                                 .
    -5....15...-8....9.....1    553
     |                     |     |
    -7    2....1.....1     0   -307
     |    |          |     |     |
   -10    1    0.....1    -1    309
     |    |                |     |
    14    3...-1.....6... -2    -61
     |                           |
   -29...58...-78...101...-118...150
.
.
a(6) = 3 as from square 6, at (-1,1) relative to the starting square, the numbers currently visible are 1 (at -1,0), 0 (at 0,0), 1 (at 0,1), and 1 (at 1,0). These four numbers sum to 3, so a(6) = 3 so that 3 + 3 = 6.
a(7) = -1 as from square 7, at (0,-1) relative to the starting square, the numbers currently visible are 3 (at -1,-1), 1 (at -1,0), 2 (at -1,1), 0 (at 0,0), 1 (at 1,1), and 1 (at 1,0). These six numbers sum to 8, so a(7) = -1 so that -1 + 8 = 7.
		

Crossrefs

A357991 Lexicographically earliest counterclockwise square spiral constructed using the nonnegative integers so that a(n) plus all other numbers currently visible from the current number form a distinct sum; start with a(0) = 0.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 3, 0, 4, 0, 0, 0, 1, 5, 0, 6, 0, 0, 1, 0, 2, 4, 0, 7, 0, 8, 0, 7, 0, 7, 0, 0, 0, 0, 0, 0, 0, 12, 0, 13, 0, 16, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 12, 0, 22, 0, 19, 0, 20, 1, 0, 0, 0, 0, 0, 0, 0, 0, 17, 0, 25, 0, 24, 0, 20, 1, 26, 0, 28, 0, 26, 0, 31, 0, 31, 0, 0, 0, 0
Offset: 0

Views

Author

Scott R. Shannon, Oct 23 2022

Keywords

Comments

A number is visible from the current number if, given that it has coordinates (x,y) relative to the current number, the greatest common divisor of |x| and |y| is 1.
In the first 50000 terms the smallest number that has not appeared is 9; it is unknown if all the positive numbers eventually appear.

Examples

			The spiral begins:
.
                       .
                       .
   0---6---0---5---1   7
   |               |   |
   0   2---1---1   0   0
   |   |       |   |   |
   1   1   0---1   0   7
   |   |           |   |
   0   3---0---4---0   0
   |                   |
   2---4---0---7---0---8
.
.
a(6) = 3 as from square 6, at (-1,-1) relative to the starting square, the numbers currently visible are 1 (at -1,0), 0 (at 0,0), 1 (at 1,0), and 1 (at 0,1). These three numbers sum to 3, so a(6) = 3 so that 3 + 3 = 6, the smallest sum that has not previous occurred.
a(8) = 4 as from square 8, at (1,-1) relative to the starting square, the numbers currently visible are 0 (at 0,-1), 1 (at -1,0), 0 (at 0,0), 1 (at 1,0), and 1 (at 0,1). These five numbers sum to 3, so a(8) = 4 so that 3 + 4 = 7, the smallest sum that has not previous occurred. Note that a(7) = 0 and forms a sum of 8.
		

Crossrefs

A361724 Lexicographically earliest sequence of distinct positive numbers on a square spiral such that the eight sums of each number with its eight nearest neighbors are distinct across the entire spiral and no number on the spiral equals any such sum.

Original entry on oeis.org

1, 2, 4, 7, 12, 14, 16, 22, 27, 10, 31, 40, 39, 46, 47, 20, 45, 52, 61, 60, 18, 80, 68, 81, 82, 70, 89, 94, 83, 48, 62, 105, 100, 69, 117, 25, 111, 129, 127, 124, 143, 106, 112, 132, 155, 119, 126, 128, 63, 56, 157, 158, 107, 178, 193, 168, 118, 170, 55, 195, 189, 197, 192, 206, 182, 211, 202
Offset: 1

Views

Author

Scott R. Shannon and Eric Angelini, Mar 22 2023

Keywords

Examples

			a(3) = 4 as a(1) + a(2) = 1 + 2 = 3, so a(3) cannot 1,2 or 3. a(3) has a(1) = 1 and a(2) = 2 as neighbors which form sums 4 + 1 = 5 and 4 + 2 = 6 neither of which have appeared, so 4 can be chosen.
a(5) = 12 as the numbers already used are 1,2,4,7, which form the sums 3,5,8,6,9,11 with their nearest neighbors. The lowest free number is therefore 10, but a(5) has a(1) = 1 as a neighbor and would create the sum 10 + 1 = 11 which has already appeared as a sum. The next free number is 12 which forms sums 12 + 7 = 19 and 12 + 1 = 13 which have not appeared, so 12 can be chosen.
		

Crossrefs

A338644 Square spiral of smallest distinct positive integers starting at 1 such that the four sums of each term with its four nearest neighbors is a prime number.

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 5, 12, 11, 8, 9, 10, 13, 16, 15, 22, 19, 24, 17, 14, 23, 18, 25, 36, 35, 26, 21, 20, 27, 34, 33, 28, 31, 52, 37, 42, 29, 54, 43, 30, 53, 44, 39, 50, 89, 48, 61, 66, 41, 32, 47, 62, 51, 46, 55, 76, 63, 38, 45, 58, 49, 60, 67, 72, 59, 68, 83, 84, 73, 78, 95, 98, 65, 74, 57, 92
Offset: 1

Views

Author

Scott R. Shannon and Eric Angelini, Apr 21 2021

Keywords

Examples

			The square spiral starts:
.
     29--42--37--52--31--28--33
      |                       |
     54  19--22--15--16--13  34
      |   |               |   |
     43  24   7---4---3  10  27
      |   |   |       |   |   |
     30  17   6   1---2   9  20
      |   |   |           |   |
     53  14   5--12--11---8  21
      |   |                   |
     44  23--18--25--36--35--26
      |
     39--50--89--48--61--66--41..
.
a(2) = 2 as a(1) + 2 = 1 + 2 = 3, the smallest possible prime number.
a(3) = 3 as a(2) + 3 = 2 + 3 = 5, the next smallest possible prime number.
a(5) = 7 as a(4) + 7 = 4 + 7 = 11. Note a(5) cannot be 5 or 6 as when these are added to 4 the result is a composite number.
a(9) = 11 as a(8) + 11 = 12 + 11 = 23, and a(2) + 11 = 2 + 11 = 13, both being prime.
		

Crossrefs

Cf. A338642 (sum to composites), A000040, A063826, A260643, A334742, A307834, A338221.
Showing 1-10 of 11 results. Next