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.

A373698 a(n) = n for n <= 3; for n > 3, a(n) is the smallest unused positive number that shares a factor with the largest odd divisor of a(n-1).

Original entry on oeis.org

1, 2, 3, 6, 9, 12, 15, 5, 10, 20, 25, 30, 18, 21, 7, 14, 28, 35, 40, 45, 24, 27, 33, 11, 22, 44, 55, 50, 60, 36, 39, 13, 26, 52, 65, 70, 42, 48, 51, 17, 34, 68, 85, 75, 54, 57, 19, 38, 76, 95, 80, 90, 63, 49, 56, 77, 66, 69, 23, 46, 92, 115, 100, 105, 72, 78, 81, 84, 87, 29, 58, 116, 145, 110
Offset: 1

Views

Author

Scott R. Shannon, Jun 13 2024

Keywords

Comments

The terms studied are all concentrated along lines of different gradient, the prime numbers, which appear in their natural order, forming the lowermost line. The central line has the highest concentration of terms and is composed of numbers with various numbers of prime factors, while many of the other lines consist of terms with the same number of prime factors. The odd terms all fall into the highest, lowest, and middle line, all other lines containing only even terms. It is conjectured the above behaviors are true for all n. See the attached images.
It appears that when a prime p > 3 is a term, it is immediately preceded by a term 3*p and followed by a term 2*p. This is true for at least the first 500000 terms. This pattern is similar to that seen in the EKG sequence A064413 but here the order of appearance of 2*p and 3*p is reversed.
Other than the first three terms the first fixed points are 42544 and 47312, and no more exist in the first 500000 terms. An examination of the graphs shows these points are due to one of the lines of concentration crossing the line a(n) = n, implying it, and probably most of the other lines, has a slight downward curvature.
In the first 100000 terms the longest run of consecutive odd and even terms is eight, starting n = 96230 and n = 30466 respectively. It in unknown if these runs can be of arbitrary length. No power of 2, other than 2 itself, can be a term.

Examples

			a(11) = 25 as a(10) = 20 which has a largest odd divisor of 5, and 25 is the smallest unused positive number that shares a factor with 5.
		

Crossrefs

Programs

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

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

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jun 19 2024

Keywords

Comments

The terms appear to follow a pattern similar to the EKG sequence A064413, i.e., the terms are concentrated along just three lines of different gradients, and the lower line consists only of primes. The uppermost line appears to be composed only of semiprimes that are divisible by 3, while the middle line contains all other terms. See the attached images. For the first 100000 terms the primes appear in their natural order, implying that is likely true for all n.
The fixed points are 1, 2, 3, 4, 16, 32, 124, and it is likely that no more exist. The sequence is conjectured to be a permutation of the positive numbers.

Examples

			a(8) = 12 as a(7) = 9 is odd, and the most recently appearing odd number prior to a(7) is a(3) = 3, and 12 is the smallest unused positive number to share a factor with 3.
		

Crossrefs

Programs

  • Mathematica
    c[] := False; j = 4; nn = 120; q[] := 0; m[_] := 1;
    Array[Set[{a[#], c[#]}, {#, True}] &, j]; q[0] = 4; q[1] = 3; u = 5;
    Do[If[EvenQ[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 *)
  • Python
    from math import gcd, lcm
    from itertools import count, islice
    def agen(): # generator of terms
        yield from [1, 2, 3, 4]
        aset, an, eo, mink = {1, 2, 3, 4}, 4, [2, 3], 5
        while True:
            s, prevan = eo[an%2], an
            an = next(k for k in count(mink) if k not in aset and gcd(s,k)>1)
            eo[prevan%2] = prevan
            aset.add(an)
            while mink in aset: mink += 1
            yield an
    print(list(islice(agen(), 77))) # Michael S. Branicky, Jun 20 2024
Showing 1-2 of 2 results.