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

A335661 The squares visited on a square (Ulam) spiral, with a(1) = 1 and a(2) = 2, when stepping to the closest unvisited square containing a number that shares a common divisor > 1 with the number in the current square. If two or more such squares are the same distance from the current square then the one with the smallest number is chosen.

Original entry on oeis.org

1, 2, 4, 6, 8, 22, 20, 40, 18, 39, 69, 105, 150, 104, 66, 38, 36, 63, 98, 62, 34, 14, 12, 3, 15, 5, 35, 60, 33, 30, 55, 88, 54, 87, 129, 177, 234, 299, 455, 375, 456, 374, 300, 235, 130, 90, 57, 93, 135, 186, 134, 92, 58, 32, 56, 91, 133, 182, 132, 180, 237
Offset: 1

Views

Author

Scott R. Shannon, Jun 17 2020

Keywords

Comments

Any even number on the square spiral has 4 diagonally adjacent squares which contain an even number and thus, unless all four such squares have been previously visited, a step to one of those adjacent squares, the one containing the smallest number, will always be possible. Any visited square containing a prime number will need to step to, and be stepped to from, a square containing a multiple of that prime number.
In the first 10 million terms the longest required step is from a(97528) = 5981, a prime number which has coordinates (39,13) relative to the starting 1-square, to a(97529) = 167468 (27*5981), with coordinates (205,-18), a step of length sqrt(28517), approximately 168.9 units. This is an extremely large step length relative to the total number of steps taken up to that point - see the attached link image. It is not surpassed by any subsequent step up to 10 million steps. If the maximum step distance between adjacent terms has a finite value or is unbounded as n increases is unknown. The largest difference between terms is for a(9404208) = 8964653 to a(9404209) = 10485343, a difference of 1520690.
In the first 10 million terms the smallest unvisited square is 37, which has coordinates (-3,3) relative to the starting 1-square. It is unknown if this square, and similar unvisited squares near the origin, is eventually visited for very large values of n or is never visited. The longest run of diagonal steps in the same direction to adjacent smaller even numbers is 52, from a(3979714) = 5051162 to a(3979766) = 4594498.

Examples

			a(3) = 4 as a(2) = 2 is surrounded by eight adjacent squares with numbers 3,4,1,8,9,10,11,12. The unvisited squares 1 unit away, 3,9,11 have no common factor with 2. Of the other squares sqrt(2) units away, 4,8,10,12, all share the common factor 2 with a(2), and the smallest of those is 4.
a(10) = 39 as a(9) = 18 is surrounded by adjacent squares 5,6,19,40,39,38,17,16. The square containing 39 is 1 unit directly left of 18 and shares the common factor 3. The other squares one unit away, 5,17,19, have no common factor with 18.
		

Crossrefs

A346294 Numbers with two or more distinct prime factors such that the number and all its prime factors fall on a single straight line when they are plotted on a square spiral.

Original entry on oeis.org

21, 24, 35, 87, 91, 99, 106, 176, 200, 273, 282, 363, 432, 507, 564, 651, 669, 951, 1333, 1445, 1805, 1837, 1963, 2669, 2813, 4163, 4557, 4625, 6321, 6643, 6685, 6723, 7225, 7567, 8333, 10152, 10252, 12826, 12877, 14761, 21409, 23317, 24651, 25337, 27391, 27419, 32039, 34225, 36673, 42029
Offset: 1

Views

Author

Scott R. Shannon, Jul 13 2021

Keywords

Comments

On a spiral spiral plot the position of a number along with all its prime factors, where the number has at least two distinct prime factors. The sequence lists those numbers for which all these points can be connected by a single straight line.
The first term with two prime factors is 21, the first with three is 273, the first with four is 65793, and the first with five is 6118203. Almost all of the later numbers lie on lines with gradient +-1 passing through or very close to the central 1 square. In general there is a concentration of term on these diagonals; see the linked image.
There are 258 terms for numbers below 100 million. In that range the largest prime factor to appear is for 69672413 = 29 * 2402497, where 2402497 has coordinate (-771,775) relative to the central 1 square, 29 is at coordinate (3,1), while the term 69672413 is at coordinate (4174,-4170).

Examples

			The square spiral is numbered as follows:
.
  17--16--15--14--13   .
   |               |   .
  18   5---4---3  12   29
   |   |       |   |   |
  19   6   1---2  11   28
   |   |           |   |
  20   7---8---9--10   27
   |                   |
  21--22--23--24--25--26
.
21 is a term as 21 = 3 * 7, and 21 is at coordinate (-2,-2) relative to the central 1 square, 3 is at coordinate (1,1), and 7 is at coordinate (-1,-1). These three points all fall on the line y = x.
87 is a term as 87 = 3 * 29, and 87 is at coordinate (5,1), 3 is at coordinate (1,1), and 29 is at coordinate (3,1). These three points all fall on the line y = 1.
200 is a term as 200 = 2^3 * 5^2, and 200 is at coordinate (-7,4), 2 is at coordinate (1,0), and 5 is at coordinate (-1,1). These three points all fall on the line y = -x/2 + 1/2.
273 is a term as 271 = 3 * 7 * 13, and 273 is at coordinate (-8,-8), 3 is at coordinate (1,1), 7 is at coordinate (-1,-1), and 13 is at coordinate (2,2). These four points all fall on the line y = x. This is the first term with three distinct prime factors.
65793 is a term as 65793 = 3 * 7 * 13 * 241, and all these points fall on the line y = x. This is the first term with four distinct prime factors.
6118203 is a term as 6118203 = 3 * 7 * 13 * 73 * 307, and all these points fall on the line y = x. This is the first term with five distinct prime factors.
		

Crossrefs

A358153 Lexicographically earliest infinite sequence of distinct positive integers on a square spiral such that each number shares a factor with its four orthogonally nearest neighbors but shares no factor with its four diagonal next-nearest neighbors.

Original entry on oeis.org

6, 10, 35, 21, 77, 22, 143, 39, 65, 117, 12, 63, 18, 20, 24, 44, 26, 273, 30, 195, 36, 88, 42, 40, 48, 14, 455, 50, 175, 80, 55, 33, 385, 147, 539, 91, 105, 110, 847, 176, 1001, 28, 119, 51, 187, 153, 85, 459, 595, 15, 54, 351, 66, 189, 72, 99, 57, 95, 114, 100, 78, 220, 52, 60, 34, 833
Offset: 1

Views

Author

Scott R. Shannon, Nov 01 2022

Keywords

Comments

This sequence is a 2D square lattice version of the Enots Wolley sequence A336957. Like that sequence, for this sequence to be infinite no number can be a prime or prime power - the first term must therefore be 6. Likewise, for each of its orthogonal nearest neighbors, a new number must have at least one prime factor that is not a factor of that neighbor. When choosing each new number a further test must also be performed against the previous number that is two squares ahead of the current number and on the edge of the spiral - this number is outside the eight nearest neighbors of the number being determined. See the examples below.
Like A336957 is it conjectured that all nonprime powers eventually appear. In the first 10000 terms the largest value is a(6975) = 3005315.

Examples

			The spiral begins:
.                                             .
                                              .
   105----91---539---147---385----33----55    99
    |                                   |     |
   110    26----44----24----20----18    80    72
    |     |                       |     |     |
   847   273    77----21----35    63   175   189
    |     |     |           |     |     |     |
   176    30    22     6----10    12    50    66
    |     |     |                 |     |     |
  1001   195   143----39----65---117   455   351
    |     |                             |     |
    28    36----88----42----40----48----14    54
    |                                         |
   119----51---187---153----85---459---595----15
.
.
a(5) = 22. The two orthogonal nearest neighbors to the square at (-1,0), relative to the starting central square 6, are 6 and 77. Therefore the new number at that position must share a factor with both of these numbers while containing a factor they do not have. Also the new number must have no factor in common with any diagonal next-nearest neighbors. Only one exists in this case, namely 21. The smallest unused number satisfying all of these conditions is 22.
a(6) = 143. For the square at (-1,-1) the orthogonal nearest neighbor is 22, while the diagonal next-nearest neighbor is 6. As 22 has 2 and 11 as factors, while 6 has 2 and 3, the new number can only be a multiple of 11, must have a factor other than 2 and 11 while not being a multiple of 2 or 3. The smallest unused number satisfying these conditions is 55. However this is where another check must be performed, namely against the number two squares ahead on the spiral from the current number - the number at (1,0) which in this case is 10. The reason this must be checked is that if 55 is chosen as the new number at (-1,-1) then that would force the next number at (0,-1) to be a multiple of 5 - only 5 and 11 are factors of 55 but 11 cannot be a factor of the new number at (0,-1) since it is an orthogonal neighbor to 22 with which it cannot share a factor. But forcing the number at (0,-1) to have 5 as a factor is not permitted since it would then share a factor with its diagonal neighbor 10 at (1,0). This is why the prime factors of the number two squares ahead on the spiral need to be checked when choosing the current number. Once a candidate number for the current square is chosen a list of the prime factors it has that are not factors of the previous number, 22 in this case, is created. This list is then compared against the factors of the number two squares ahead on the spiral, if such a number exists. If that number has as factors all the numbers in the list, then a new candidate number must be chosen else it would lead to the issue described above when the next new number is created. In this case choosing 55 leads to a list containing only 5, but that is a factor of 10, so 55 cannot be chosen. The next valid number that satisfies all the factor requirements and also has a factor not in either 22 or 10 is 11*13 = 143.
		

Crossrefs

Showing 1-3 of 3 results.