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.

A373999 a(1) = 1, a(2) = 2, a(3) = 3, a(4) = 5, a(5) = 7; for n > 5, a(n) is the smallest unused positive number that is coprime to a(n-1), a(n-2) and a(n-3) but has a common factor with at least one of a(1)...a(n-4).

Original entry on oeis.org

1, 2, 3, 5, 7, 4, 9, 25, 49, 8, 27, 55, 91, 16, 51, 11, 13, 10, 17, 21, 121, 20, 169, 57, 77, 32, 65, 19, 33, 14, 85, 247, 69, 22, 35, 221, 23, 6, 95, 119, 143, 12, 115, 133, 187, 18, 125, 161, 209, 24, 145, 217, 253, 26, 15, 29, 31, 28, 39, 185, 289, 38, 63, 37, 155, 34, 81, 203, 205, 44
Offset: 1

Views

Author

Scott R. Shannon, Jun 24 2024

Keywords

Comments

Initially the terms agree with the observation noted in A373998 and are concentrated predominantly along five lines of different gradient, with the primes forming the lowermost line. However this pattern is disrupted by the second lowest line showing a repetitive discontinuous jump to lower values which also interrupts the third middle line. An examination of the terms shows this is due to the appearance of three consecutive terms which are not divisible by 2 or 3. This allows subsequent terms to be a low multiple of 2 and 3, forming numbers which are less than the most recently appearing prime values. Also of note is after approximately 85000 terms the upper two lines merge; it is assumed that the remaining four lines continue in the above pattern as n grows arbitrarily large, although this is unknown.
Other than the first three terms the fixed points in the first 100000 terms are 35, 63, 219, 231, 1407, 2967, 3003, 6555, 14007, 14031, 32103, 77343, although it is likely more exist. For the terms studied the primes appear in their natural order. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(9) = 49 as 49 is the smallest unused number that is coprime to a(6) = 4, a(7) = 9, and a(8) = 25, while sharing a factor with a(5) = 7.
		

Crossrefs

Programs

  • Python
    from math import gcd, lcm
    from itertools import count, islice
    def agen(): # generator of terms
        alst = [1, 2, 3, 5, 7]
        yield from alst
        aset, LCM, mink = set(alst), lcm(*alst[:-3]), 4
        while True:
            an = next(k for k in count(mink) if k not in aset and all(1 == gcd(k, m) for m in alst[-3:]) and gcd(k, LCM) > 1)
            LCM = lcm(LCM, alst[-3])
            alst.append(an)
            aset.add(an)
            while mink in aset: mink += 1
            yield an
    print(list(islice(agen(), 70))) # Michael S. Branicky, Jun 24 2024