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.

Previous Showing 31-40 of 51 results. Next

A280027 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 can be seen from that cell.

Original entry on oeis.org

1, 1, 2, 4, 7, 13, 23, 42, 76, 146, 239, 441, 852, 1389, 2536, 4971, 9832, 15312, 27964, 54801, 108787, 169086, 308758, 603612, 1201837, 2397202, 3656904, 6687912, 13067709, 25998877, 51918269, 79176868, 144799285, 282915788, 562653823, 1124083053, 2246758839
Offset: 0

Views

Author

N. J. A. Sloane, Dec 24 2016

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).
"Can be seen from" means "that are on the same row, column, diagonal, or antidiagonal as".

Examples

			The central portion of the spiral is:
.
     7----4----2
     |         |
    13    1----1  239
     |             |
    23---42---76--146
.
After the terms a(0) to a(8) of the spiral have been filled in, the next cell contains 76+42+23+1+4 = 146 = a(9).
		

Crossrefs

Extensions

More terms from Lars Blomberg, Dec 25 2016

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

A280026 Fill an infinite square array by following a spiral around the origin; in the n-th cell, enter the number of earlier cells that can be seen from that cell.

Original entry on oeis.org

0, 1, 2, 3, 3, 4, 4, 5, 6, 5, 6, 7, 6, 7, 8, 9, 7, 8, 9, 10, 8, 9, 10, 11, 12, 9, 10, 11, 12, 13, 10, 11, 12, 13, 14, 15, 11, 12, 13, 14, 15, 16, 12, 13, 14, 15, 16, 17, 18, 13, 14, 15, 16, 17, 18, 19, 14, 15, 16, 17, 18, 19, 20, 21, 15, 16, 17, 18, 19, 20, 21
Offset: 0

Views

Author

N. J. A. Sloane, Dec 24 2016

Keywords

Comments

The spiral track being used here is the same as in A274640, except that the starting cell here is numbered 0 (as in A274641).
"Can be seen from" means "are on the same row, column, diagonal, or antidiagonal as".
The entry in a cell gives the number of earlier cells that are occupied in any of the eight cardinal directions. - Robert G. Wilson v, Dec 25 2016
First occurrence of k = 0,1,2,3,...: 0, 1, 2, 3, 5, 7, 8, 11, 14, 15, 19, 23, 24, 29, 34, 35, 41, 47, 48, 55, 62, ... - Robert G. Wilson v, Dec 25 2016

Examples

			The central portion of the spiral is:
.
    7---9---8---7---6
    |               |
    8   3---3---2   7
    |   |       |   |
    9   4   0---1   6
    |   |           |
   10   4---5---6---5
    |
    8---9--10--11--12 ...
		

Crossrefs

See A280027 for an additive version.
See A279211, A279212 for versions that follow antidiagonals in just one quadrant.

Programs

  • Mathematica
    a[n_] := a[n - 1] + If[ IntegerQ@ Sqrt@ n || IntegerQ@ Sqrt[4n +1], 2 - Select[{Sqrt@ n, (Sqrt[4n +1] -1)/2}, IntegerQ][[1]], 1]; a[0] = 0; Array[a, 76, 0] (* Robert G. Wilson v, Dec 25 2016 *)

Formula

Empirically: a(0)=0, a(n+1)=a(n)+d for n>0, when n=k^2 or n=k*(k+1) then d=2-k, else d=1.

Extensions

Corrected a(23) and more terms from Lars Blomberg, Dec 25 2016

A275103 Hilbert curve constructed by greedy algorithm, such that each element is the smallest positive integer possible and that all rows, columns, and diagonals contain distinct numbers.

Original entry on oeis.org

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

Views

Author

Kerry Mitchell, Jul 16 2016

Keywords

Comments

The n-th cell has x-coordinates given by A059252 and y-coordinates given by A059253.
This idea is similar to A269526 and A274640, but for a different curve.

Examples

			The Hilbert curve begins:
  1,   4,   2,   3, ...
  2,   3,   5,   1, ...
  5,   6,   4,   2, ...
  4,   2,   1,   5, ...
...
		

Crossrefs

Cf. A269526 uses antidiagonals instead of the Hilbert curve and A274640 uses a square spiral.

A324481 Index of first occurrence of n in the spiral shown in A274641.

Original entry on oeis.org

0, 1, 2, 3, 7, 8, 26, 27, 30, 34, 35, 48, 55, 62, 63, 80, 101, 119, 130, 131, 155, 180, 210, 224, 253, 254, 271, 303, 305, 321, 322, 323, 419, 483, 504, 505, 568, 571, 573, 624, 649, 650, 728, 755, 810, 812, 840, 898, 953, 954, 956, 957, 959, 960, 1189
Offset: 0

Views

Author

N. J. A. Sloane, Mar 11 2019

Keywords

Comments

Also index of first occurrence of n+1 in the spiral shown in A274640.

Crossrefs

Programs

  • Python
    A324481 = lambda n: next(i for i,a in enumerate(A274640()) if a==n+1) # slow
    
  • Python
    def A324481(): # generator of the sequence
       n=1
       for i,a in enumerate(A274640()):
          if a==n: yield i; n += 1
    [a for a,A324481(),range(99))%5D%20%23%20_M.%20F.%20Hasler"> in zip(A324481(),range(99))] # _M. F. Hasler, Feb 01 2025

Formula

Conjecture: a(n) = c(n)*n^2 with 0.32 <= c(n) <= 1 for all n, maybe lim c(n) ~ 0.4. - M. F. Hasler, Feb 01 2025

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

A361486 Lexicographically earliest sequence of positive numbers on a square spiral such that no three equal numbers are collinear.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Mar 13 2023

Keywords

Comments

The first term a(1) = 1 lies at the (0,0) origin while all other terms lie on integer coordinates.

Examples

			a(5) = 2 as a(3) = 1 and a(4) = 1 lie on the horizontal line y = 1 relative to the starting square (assuming a counter-clockwise spiral) so a(5) cannot be 1.
a(7) = 3 as a(5) = 2 and a(6) = 2 lie on the vertical line x = -1 so a(7) cannot be 2, while a(1) = 1 and a(3) = 1 lie on the line y = x so a(7) cannot be 1.
a(21) = 4 as a(18) = 3 and a(19) = 3 lie on the line x = -2, a(6) = 2 and a(15) = 2 lie on the line y = 2*x + 2, while a(1) = 1 and a(3) = 1 lie on the line y = x, so a(21) cannot be 1, 2 or 3.
		

Crossrefs

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

A361702 Lexicographically earliest sequence of positive numbers on a square spiral such that no four equal numbers lie on the circumference of a circle.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Mar 21 2023

Keywords

Comments

The first term a(1) = 1 lies at the (0,0) origin while all other terms lie on integer coordinates.

Examples

			a(4) = 2 as a(1) = a(2) = a(3) = 1 all lie on the circumference of a circle with radius 1/sqrt(2) centered at (1/2,1/2), assuming a counter-clockwise spiral, so a(4) cannot be 1.
a(12) = 3 as a(2) = a(3) = a(11) = 1 all lie on the circumference of a circle with radius 1/sqrt(2) centered at (3/2,1/2), so a(12) cannot be 1, while a(4) = a(8) = a(10) = 2 all lie on the circumference of a circle with radius sqrt(2) centered at (1,0), so a(12) cannot be 2.
a(22) = 4 as a(1) = a(2) = a(7) = 1 all lie on the circumference of a circle with radius sqrt(10)/2 centered at (1/2,-3/2), so a(22) cannot be 1, a(6) = a(19) = a(21) = 2 all lie on the circumference of a circle with radius sqrt(5)/2 centered at (-3/2,-1), so a(22) cannot be 2, while a(12) = a(16) = a(20) = 3 all lie on the circumference of a circle with radius sqrt(5) centered at (0,0), so a(22) cannot be 3.
		

Crossrefs

Previous Showing 31-40 of 51 results. Next