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.

A336799 The numbers visited on a square spiral, with a(1)=1, a(2)=2, a(3) = 6, when stepping to an unvisited number as close as possible to the n = 1 starting position that has at least one common factor with the last visited number but none with the second last visited number. In case of a tie, choose the smallest number.

Original entry on oeis.org

1, 2, 6, 15, 35, 14, 12, 33, 77, 28, 10, 45, 21, 56, 20, 55, 99, 18, 34, 85, 75, 24, 22, 143, 39, 30, 46, 161, 63, 36, 40, 95, 57, 42, 26, 65, 105, 48, 38, 247, 117, 69, 115, 70, 44, 187, 51, 54, 52, 91, 119, 68, 60, 87, 203, 98, 62, 93, 129, 86, 76, 133, 175, 50, 78, 141, 235, 80, 58, 261
Offset: 1

Views

Author

Scott R. Shannon, Jan 27 2021

Keywords

Comments

This sequence is the square spiral version of the Enots Wolley sequence A336957. The same rules for selecting the next number apply except that, instead of choosing the smallest unvisited number for a(n), the number closest to the starting n = 1 position which satisfies the selection rules is chosen. If two or more such numbers exist then the smallest is chosen.
The first term that differs from A336957 is a(9) = 77. See the examples below.

Examples

			The square spiral used is:
.
  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
.
a(8) = 33 as a(7) = 12 = 2*2*3 and a(6) = 14 = 2*7, thus a(8) must contain 3 or 2 as a factor but not 2 or 7. As a(6) excludes 2 it must contain 3 as a factor, and another prime other than 3. The closest unvisited number to the starting 1 position that satisfies these conditions is 33.
a(9) = 77 as a(8) = 33 = 3*11 and a(7) = 12 = 2*2*3, thus a(9) must contain 3 or 11 as a factor but not 2 or 3. As a(7) excludes 3 it must contain 11 as a factor, and another prime other than 11. The smallest unvisited number satisfying these conditions is 55, which is sqrt(20) ~ 4.47 units from 1. However 77 is unvisited and also satisfies the conditions, and is only 4 units from 1, thus a(9) = 77. This is the first term that differs from A336957.
		

Crossrefs

A340807 a(n) = n if n <= 3; for n > 3, a(n) is the closest number to a(n-2) that has not occurred earlier and has at least one common factor with a(n-2), but none with a(n-1). In case of a tie, choose the smaller.

Original entry on oeis.org

1, 2, 3, 4, 9, 8, 15, 14, 5, 12, 25, 16, 35, 18, 49, 20, 63, 22, 57, 26, 51, 28, 45, 32, 39, 34, 33, 38, 27, 40, 21, 44, 7, 46, 77, 48, 91, 50, 117, 55, 114, 65, 112, 75, 116, 69, 118, 81, 122, 87, 124, 99, 128, 93, 130, 111, 134, 105, 136, 95, 138, 85, 141, 80, 147, 82, 153, 86, 159, 88
Offset: 1

Views

Author

Scott R. Shannon, Jan 22 2021

Keywords

Comments

The sequence uses a similar selection rule to the Yellowstone permutation A098550 but instead of choosing the smallest number that has not occurred earlier that has a common factor with a(n-2) and no common factor with a(n-1), the number closest to a(n-2) that satisfies these rules is selected for a(n). If two such numbers are the same distance from a(n-2) then the smaller is chosen.
Many terms are clustered along a line with gradient approximately 1.33. However, along this line the terms often rapidly drop to much smaller values before returning to the main line. More interesting is the existence of regions on the same line where the terms split and form two lines of constantly increasing values. These lines continue until they both start decreasing again to rejoin near the original line.
In the first 15 million terms the maximum number of consecutive increasing terms is seven. This run starts at n = 47685. The maximum number of consecutive decreasing terms is also seven. This starts at n = 4134621.
In the first 15 million terms the fixed points, other than the first three terms, are 4, 323, 516718, 2199679, 2401224. As the terms for larger n seem to drop below the a(n)=n line on numerous occasions, it is possible that more exist, although this is unknown. The smallest number not appearing is 6, although other small values appear after many terms, e.g. a(4946191) = 23. It is unknown if all values eventually appear. The largest change in consecutive terms is from a(399922)=527754 to a(399923)=2887, a difference of 524867.
See also A340783 where the next term is the closest to a(n-1).

Examples

			a(5) = 9 as a(5-2) = a(3) = 3 so a(5) must have 3 as a factor, but cannot be 6 = 3*2 as it cannot have a common factor with a(5-1) = a(4) = 2.
a(12) = 16 as a(12-2) = a(10) = 12 so a(12) must have 2 or 3 as a factor, but cannot have a common factor with a(12-1) = a(11) = 25 = 5*5. The closest numbers to a(12-2) = a(10) = 12 which have 2 or 3 as a factor but not 5 are 8,9,14,16. The first three have already appeared so a(12) = 16.
		

Crossrefs

Programs

  • PARI
    See Links section.

A335585 The numbers visited on a square spiral, with a(n) = n for 1 <= n <= 3, when stepping to an unvisited number as close as possible to the n = 1 starting position that has at least one common factor with the second last visited number but none with the last visited number. In case of a tie, choose the smallest number.

Original entry on oeis.org

1, 2, 3, 4, 9, 8, 15, 14, 5, 6, 25, 12, 35, 16, 7, 10, 21, 20, 27, 22, 39, 11, 18, 77, 24, 49, 34, 63, 17, 28, 51, 40, 33, 46, 45, 23, 30, 161, 26, 69, 13, 36, 65, 32, 55, 38, 75, 19, 42, 95, 44, 85, 48, 115, 52, 105, 62, 87, 68, 29, 54, 203, 60, 119, 76, 153, 70, 117, 50, 57, 56, 81, 58, 93
Offset: 1

Views

Author

Scott R. Shannon, Jan 26 2021

Keywords

Comments

This sequence is the square spiral version of the Yellowstone permutation A098550. The same rules for selecting the next number apply except that, instead of choosing the smallest unvisited number for a(n), the number closest to the starting n = 1 position which satisfies the selection rules is chosen. If two or more such numbers exist then the smallest is chosen.
The first term that differs from A098550 is a(23) = 18. See the examples below.

Examples

			The square spiral used is:
.
  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
.
a(7) = 15 as a(5) = 9 = 3*3 and a(8) = 8 = 2*2*2, thus a(7) must contain 3 as a factor but not 2. The closest unvisited number to the starting 1 position that satisfies these conditions is 15.
a(23) = 18 as a(21) = 39 = 3*13 and a(22) = 11, thus a(23) must contain 3 or 13 as a factor but not 11. The smallest unvisited number satisfying these conditions is 13, which is sqrt(8) units from 1. However 18 is unvisited and also satisfies the conditions, and is only sqrt(5) units from 1, thus a(23) = 18. This is the first term that differs from A098550.
		

Crossrefs

A340779 a(1)=1, a(2)=2; for n>=3, a(n) = the closest number to a(n-1) that has not occurred earlier and has at least one common factor with a(n-1), but none with a(n-2). In case of a tie, choose the smaller.

Original entry on oeis.org

1, 2, 6, 15, 35, 28, 26, 39, 33, 22, 20, 45, 51, 34, 38, 57, 63, 56, 58, 87, 93, 62, 68, 85, 75, 72, 74, 185, 175, 168, 166, 415, 405, 402, 404, 505, 495, 492, 494, 481, 407, 396, 394, 985, 975, 972, 974, 2435, 2425, 2328, 2326, 5815, 5805, 5802, 5804, 7255, 7245, 7242, 7244, 9055
Offset: 1

Views

Author

Scott R. Shannon, Jan 21 2021

Keywords

Comments

The sequence uses a similar selection rule to the Enots Wolley sequence A336957 but instead of choosing the smallest number that has not occurred earlier that has a common factor with a(n-1) and no common factor with a(n-2), the number closest to a(n-1) that satisfies these rules is selected for a(n). If two such numbers are the same distance from a(n-1) then the smaller is chosen. Like A336957 for the sequence to continue a(n) must always have a prime factor not in a(n-1), thus a(n) cannot be a prime or a prime power.
The sequence grows sporadically with n, showing regions of little growth followed by a large jump due to the next term being the multiple of a large prime of the previous term. However due to the overall rapid increase in the terms it is very unlikely any fixed points exist.

Examples

			a(5) = 35 as a(4) = 15 = 3*5 and a(3) = 6 = 2*3, thus a(5) must be a multiple of 5 while not being a multiple of 3, and must have a prime factor other than 5. The smallest unused number closest to 15 satisfying these criteria is 35.
a(6) = 28 as a(5) = 35 = 5*7 and a(4) = 15 = 3*5, this a(6) must be a multiple of 7 while not being a multiple of 5, and must have a prime factor other than 7. The smallest number satisfying these criteria is 14. However 28 also does and is only 7 away from a(5), while 14 is 21 away, thus 28 is chosen. This is the first term that differs from A336957.
		

Crossrefs

Showing 1-4 of 4 results.