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

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

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

Showing 1-2 of 2 results.