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.

A373623 a(n) = n for n <= 3; for n > 3, a(n) is the smallest unused positive number that shares a factor with the most recently appearing even number if a(n-1) is odd, otherwise it shares a factor with the most recently appearing odd number if a(n-1) is even.

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 8, 12, 15, 10, 5, 14, 20, 25, 16, 30, 35, 18, 7, 21, 22, 24, 27, 26, 33, 13, 28, 39, 32, 36, 42, 45, 34, 40, 48, 50, 51, 38, 17, 19, 44, 57, 11, 46, 55, 23, 52, 69, 54, 60, 63, 56, 49, 58, 70, 77, 62, 66, 84, 88, 91, 64, 65, 68, 75, 72, 78, 80, 81, 74, 87, 37, 76, 111, 82, 90, 93
Offset: 1

Views

Author

Scott R. Shannon, Jun 11 2024

Keywords

Comments

The terms studied are all concentrated along lines of different gradient; the prime numbers are all distributed on the lines with gradient < 1 while all other numbers are on the lines with gradient > 1, the highest concentration of terms appearing on a line with gradient ~ 1.04. The uppermost of these lines appear to consist entirely of numbers with two or three distinct prime factors. See the attached images. It is conjectured that this behavior is true for all n.
The primes do not appear in their natural order, with 13 appearing before 11 being the first example. The fixes points being 1, 2, 3, 4, 10, 18, 38; it is likely no more exist.
In the first 200000 terms the longest run of consecutive even terms is eight, beginning at a(7681) = 8078, while the longest run of consecutive odd terms is seven, beginning at a(101234) = 105471. It in unknown if these runs can be of arbitrary length. The sequence is conjectured to be a permutation of the positive numbers.

Examples

			a(5) = 6 as a(4) = 4 is even and the most recently appearing odd term is a(3) = 3, and 6 is the smallest unused positive number that shares a factor with 3.
a(7) = 8 as a(6) = 9 is odd and the most recently appearing even term is a(5) = 6, and 8 is the smallest unused positive number that shares a factor with 6.
		

Crossrefs

Programs

  • Mathematica
    c[] := False; j = 3; nn = 120; q[] := 0; m[_] := 1;
    Array[Set[{a[#], c[#]}, {#, True}] &, j]; q[0] = 2; q[1] = 3; u = 5;
    Do[If[OddQ[j],
       If[PrimePowerQ[q[0]], k = m[2];
         While[c[2 k], k++]; k *= 2; While[c[2 m[2]], m[2]++],
         k = u; While[Or[c[k], CoprimeQ[q[0], k]], k++]],
       If[PrimePowerQ[q[1]],
         (k = m[#]; While[c[k #], k++]; k *= #;
           While[c[#  m[#]], m[#]++]) &[FactorInteger[q[1]][[1, 1]]],
         k = u; While[Or[c[k], CoprimeQ[q[1], k]], k++]] ]; q[Mod[j, 2]] = j;
      Set[{a[n], c[k], j}, {k, True, k}];
      If[k == u, While[c[u], u++]], {n, j + 1, nn}];
    Array[a, nn] (* Michael De Vlieger, Jun 20 2024 *)