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.

A358337 Earliest infinite sequence of distinct integers on a square spiral such that every number equals the sum of its four adjacent neighbors. See the Comments.

Original entry on oeis.org

0, 1, -1, 2, -2, 3, -3, -6, 6, 4, -4, 9, -5, -13, 5, -17, 11, 10, 8, -20, -11, 20, -9, 7, -15, -10, 17, -18, 19, -22, -8, 21, -12, 33, -31, -21, -19, 39, -7, 15, -14, 14, 12, -25, 43, -30, 25, -16, 22, 13, -34, 41, -50, 50, -28, 26, -24, -33, 46, -53, 71, -26, 18, 23, -27, -60, 54, -71, 28, -23
Offset: 0

Views

Author

Scott R. Shannon, Nov 10 2022

Keywords

Comments

We define earliest as the number with the smallest magnitude, and where a positive number is considered earlier than its negative value.
To ensure the sequence is infinite, other than tracking the numbers that have already appeared in the spiral, one must also calculate the numbers around the outside of the spiral whose values have been fixed by their nearest neighbor on the spiral already having three neighbors with set values. These numbers may have similar neighbors which will force the calculation of other values in a cascade of new fixed numbers that appear as a square diamond shape around the currently filled spiral. When the lowest available number is to be chosen one must ensure it does not equal any of these predetermined values. One additional check must be performed to ensure the sequence is infinite; see the examples below. Unlike A358151 here the numbers along the rows/columns are smaller towards the ends of the rows/columns and larger in the middle. See the linked images.
The values that are positive and negative make a pattern around the spiral axes; see the second linked image. There is no occurrence in the first 500000 terms where a positive number is surrounded by eight negative numbers, or vice versa. It is unknown is this can occur.
The sequence is conjectured to be a permutation of the integers. The values grow rapidly in size, e.g., in the first 1000 terms the largest magnitude number is a(976) = -2492394, while the largest magnitude number in the first 500000 terms is a(499495) = -749...021, a number containing 147 digits.

Examples

			The square spiral begins:
.                            .
                             .
   11...-17...5..-13...-5   -22
    |                   |    |
   10   -2....2...-1    9    19
    |    |         |    |    |
    8    3    0....1   -4   -18
    |    |              |    |
  -20   -3...-6....6....4    17
    |                        |
  -11...20...-9....7...-15..-10
.
.
See the attached text file for a larger 31 by 31 example.
a(0) = 0. The earliest available integer.
a(1)..a(6) = 1,-1,2,-2,3,-3. These are the earliest available six numbers.
a(7) = -6. This number is fixed by previous numbers as a(0) must equal a(1) + a(3) + a(5) + a(7), therefore a(7) = 0 - 1 - 2 - 3 = -6.
a(8) = 6. The earliest available numbers when a(8) is filled are 4,-4,5,-5 but none of those can be chosen else the sequence would not be infinite. Choosing a(8) = 4 would force a(10), the number next to a(1) = 1, to equal 1 - (-1) - 0 - 4 = = -2, but -2 has already appeared. Choosing a(8) = -4 would force the number below a(7) = -6 to equal -6 - (-3) - 0 - (-4) = 1, but 1 has already appeared. Choosing a(8) = 5 would force a(10) to equal -3 which has already appeared. Note however that 5 has already been excluded as the number above a(3) = 2 must equal 2 - (-2) - (-1) - 0 = 5. Finally, choosing a(8) = -5 would force the number below a(7) to equal 2 which has already appeared. This leave 6 as the earliest available number.
a(9) = 4 as this is the earliest available number and it is not excluded by earlier numbers or by the four forced numbers already calculated around the four existing spiral edges.
a(21) = -11. Another check must be performed when choosing the earliest available number which is first seen when finding a(21). As that number is chosen the spiral is:
.
       (15)    8     3
   A   (X)   -20    -3
        B      *   (20)
               C
.
where '*' marks the position of a(21) at the lowest-left corner of the spiral, numbers surrounded by brackets are not yet in the sequence but have been fixed by earlier numbers, and 'A','B','C' are not yet fixed. When a(21) is being chosen the earliest available number is -10. If -10 is chosen for '*' then 'X' would be forced to equal -15. But note that 'X' minus 15, the number above it, equals -30, while '*' minus the number next to it is -10 - 20 = -30. But when now calculating the number 'A' we have A = -15 - 15 - (-20) - B, while when calculating 'C' we have C = -10 - 20 - (-20) - B. Note the last two terms are shared, and as -15 - 15 = -10 - 20 that would imply A = C. This is not allowed, so a(21) cannot be -10. The general rule is if the difference between the number being chosen and its orthogonal neighbor is the same as the difference between the number diagonally adjacent to it with that number's orthogonal neighbor then the chosen number must be rejected. As -10 is not possible and 11 has already appeared a(21) = -11.
		

Crossrefs

Cf. A358151 (eight neighbors), A358254, A354441, A354435, A358048, A344659.

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

A363372 Lexicographically earliest infinite sequence of positive numbers on a square spiral such that every 3 by 3 block of numbers contains the digits 1 through 9.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, May 29 2023

Keywords

Comments

The numbers are determined by a recursive backtracking search starting from a(1) = 1. Additional optimization of available candidate values is achieved by checking the undetermined squares on the spiral that will form part of the 3 x 3 block of numbers the term currently being determined lies in; these are checked for numbers that they cannot contain and comparing those with similar values in other undetermined squares in the same 3 by 3 block. If all of these squares contain the same excluded value or values then these form the list of candidate numbers the current square must contain. If no such excluded shared value exists then the current square's list of candidate values is all those numbers that are not excluded by its neighbors in any surrounded 3 by 3 block of numbers.
Although significant backtracking is required using the above algorithm one finds that the resulting numbers form a repeating pattern of three values in three rows and columns in each of the four orthogonal quadrants around the starting square; this implies the sequence is indeed infinite in the resulting pattern of rows and columns. See the attached colored image. One finds, assuming a counter-clockwise numbered spiral, that the only repeating rows or columns that cross the quadrant boundaries are the column of values 5,6,7,5,6,7,5... on the left side of the spiral relative to the starting square, and the column 5,7,6,5,7,6,5,... on the right side.

Examples

			a(17) = 8. This is the first term that is determined by considering the excluded values of the other undetermined squares in the current 3 by 3 block. As a(8) = 8, at coordinate (0,-1) relative to the starting square, 8 is excluded as a possible candidate for a(18), at coordinate (-2,1), and a(19), at coordinate (-2,0). Therefore a(17), at coordinate (-2,2), must equal 8 as there is no other square in the current 3 by 3 block, centered at (-1,1), that can contain it.
a(32) = 6. This is the first term that fails the above checking of excluded candidates in the current 3 by 3 block, forcing the algorithm to backtrack when determining a(35). Using that check one finds that 2 is the smallest valid choice for a(32), followed by a(33) = 6 and a(34) = 1. But these choices leave a(35) having no available candidate value as all numbers 1 through 9 are already in its surrounding 3 by 3 blocks of values. This leaves a(32) = 6 as the next smallest candidate, a value that leads to a(35) also having 6 as a valid candidate.
		

Crossrefs

A363665 Starting with a(1) = 1, the lexicographically earliest sequence of integers on a square spiral such that every number equals the sum of its eight adjacent neighbors.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -2, 0, 0, 1, -2, 0, 0, 0, -1, 0, 0, 0, -2, 2, 0, 0, -1, 2, -3, 0, 0, 3, -2, 2, -3, 0, 0, 3, -1, -1, 1, 0, 0, 1, 0, 0, -5, 8, 0, 0, -5, 4, 0, 4, -7, 0, 0, 6, -6, 4, -4, 8, -7, 0, 0, 2, -2, 4, -4, 0, 7, 0, 0, -8, 6, 3, -8, 10, -15, 16, 0, 0, -9, 6, -5, 7, -8, 13
Offset: 1

Views

Author

Scott R. Shannon, Jun 14 2023

Keywords

Comments

As the terms are not distinct the first two numbers of any new row or column will always be zero. In the first 500000 terms the last zero that is not at the beginning of a row or column is a(190) = 0. Is it unknown if more such zeros exist. In the same range the smallest positive numbers not yet occurring are 5, 9, 11, 12, 15, 19, 20, ... . It is unknown if all integers eventually appear. The terms increase rapidly in size; in the first 500000 terms the largest positive term is a(499848) = 1267...5398, a number with 226 digits.

Examples

			The spiral begins:
.                               .
.                               |
    0__-3___2__-2___3___0___0  -7
    |                       |   |
    0   0__-2___1___0___0  -3   4
    |   |               |   |   |
    3   0   0___0___0  -2   2   0
    |   |   |       |   |   |   |
   -1   0   0   1___0   0  -1   4
    |   |   |           |   |   |
   -1  -1   0___0___1___0   0  -5
    |   |                   |   |
    1   0___0___0__-2___2___0   0
    |                           |
    0___0___1___0___0__-5___8___0
.
.
a(9) = 1 as a(1) = 1 and a(2)..a(8) = 0, therefore a(9) = 1 so the sum of the eight numbers around a(1) equals 1.
a(12) = -2 as a(2) = 0 while a(1), a(9) = 1, a(2)..a(4), a(8), a(10), a(11) = 0, therefore a(12) = -2 so the sum of the eight numbers around a(1) equals 0.
		

Crossrefs

Showing 1-4 of 4 results.