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.

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

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Jun 03 2024

Keywords

Comments

The sequence uses a criterion for selecting the next term similar to those that define A098550 and A247942, but here all terms prior to a(n-1) can be checked for a common factor with a(n).
Comment from N. J. A. Sloane, Jun 19 2024 (Start)
Theorem: This is a permutation of the positive integers.
Proof: This follows from arguments similar to those used to prove that other "lexicographically earliest" sequences are permutations. Here is a sketch of the steps.
1. Sequence is infinite. (Easy: a(n-2) times a giant prime is always a candidate for a(n).)
2. Let w(n) = index of n when it appears, or -1 if n never appears. Let W(n) = max {w(1), ..., w(n)}. Then i > W(n) implies a(i) > n. [In words, the rules imply that there is a threshold W(n) such that if n has not appeared by the time you have looked at the first W(n) terms, then n will never appear.]
3. For any prime p, there is an n with p | a(n). For if not, no prime q > p can divide any term either, or we could have used p instead of q. So all terms are a product of primes < p. Now consider a term a(m) with m > W(p!), and let q < p be the smallest prime factor of a(m). Then q*p < p! < a(m) is a smaller candidate for a(m). Contradiction.
4. For any prime p there are infinitely many terms divisible by p. For if not, choose a power of p, p^r say, that is greater than any multiple of p in the sequence, and then choose a prime Q > p^r. Look at the first term, k*Q say, that is divisible by Q. But then k*p^r would have been a smaller choice than k*Q. Contradiction.
5. For any prime p, there is a term a(n) = p. In words, every prime appears naked. Proof: Choose a giant multiple of p, G*p say. Then p would have been a smaller choice than G*p. Contradiction.
6. (This is the only tricky step.) Every number appears. Suppose k = p1*p2*p3 (say) never appears (we know from 5 that we can assume k is not itself a prime). Find a giant multiple of p1, a(n) = G*p1. Then k is a candidate for a(n+2), unless gcd(k,a(n+1)) > 1. So gcd(k, a(n+1)) > 1 is forced. But then, equally, gcd(k, a(n+2)) > 1 is forced, or else we could set a(n+3) = k. And so on. So every term after a(n) must have a common factor with k. This is impossible by 5.
This completes the proof. (End)
A373790 has several as-yet unproved conjectures related to this sequence. - N. J. A. Sloane, Jun 23 2024
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 gradient, and the lower line consists only of primes. Prime powers appear in the upper two lines, with the powers of 2 greater than 32 falling on the middle line while all others fall on the top line. See the attached image for the first 1000 terms. 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, 18, 20, 22, 32, 98, and it is likely that no more exist. Given that A098550 and A247942 are permutations of the positive integers, it is almost certainly true that this sequence is also. [This is true - see the above Theorem. - N. J. A. Sloane, Jun 20 2024]
From Michael De Vlieger, Jun 07 2024: (Start)
A scatterplot of the sequence shows 3 trajectories as follows:
"Alpha" is a trajectory of odd composite numbers (highest slope).
"Gamma" is a trajectory of even composite numbers.
"Beta" is the trajectory of primes and the number 1 (lowest slope). (End) [The points on the three trajectories are listed in A372080 and A372081 (alpha), A373786 and A373787 (gamma), and A372073 (beta). - N. J. A. Sloane, Jun 20 2024]

Examples

			a(11) = 7 as 7 is coprime to a(10) = 6 while sharing a factor with a(8) = 14. This is the first term to differ from A098550.
a(38) = 77 as 77 is coprime to a(37) = 30 while sharing a factor with a(30) = 28. This is the first term to differ from A247942.
		

Crossrefs

Programs

  • Mathematica
    c[] := False; p[] := False; nn = 120;
    Array[Set[{a[#], c[#], p[#]}, {#, True, True}] &, 3];
    i = a[2]; j = a[3]; u = 4;
    Do[k = u;
     While[Or[c[k], ! CoprimeQ[j, k],
       NoneTrue[Set[s, #], p] &@FactorInteger[k][[All, 1]]], k++];
     Map[Set[p[#], True] &, s];
     Set[{a[n], c[k], i, j}, {k, True, j, k}];
     If[k == u, While[c[u], u++]], {n, 4, nn}];
    Array[a, nn] (* Michael De Vlieger, Jun 06 2024 *)
  • Python
    from math import gcd, lcm
    from itertools import count, islice
    def agen(): # generator of terms
        yield from [1, 2, 3]
        aset, an, LCM, mink = {1, 2, 3}, 3, 6, 4
        while True:
            an = next(k for k in count(mink) if k not in aset and gcd(k, an) == 1 and gcd(k, LCM) > 1)
            LCM = lcm(LCM, an)
            aset.add(an)
            while mink in aset: mink += 1
            yield an
    print(list(islice(agen(), 76))) # Michael S. Branicky, Jun 18 2024

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

Original entry on oeis.org

1, 2, 3, 5, 4, 9, 25, 8, 21, 55, 16, 7, 11, 6, 35, 121, 12, 49, 65, 18, 77, 13, 10, 27, 91, 20, 33, 119, 26, 15, 17, 14, 39, 85, 22, 57, 115, 28, 19, 23, 24, 95, 143, 32, 45, 133, 34, 69, 125, 38, 51, 145, 44, 63, 29, 40, 81, 161, 50, 87, 169, 46, 75, 187, 52, 93, 175, 58, 31, 99, 56, 155
Offset: 1

Views

Author

Scott R. Shannon, Jun 24 2024

Keywords

Comments

For the terms studied, and similar to A373390 and A089088, the terms are concentrated along distinct lines of different gradient, four in this sequence, and like those sequences, the lowermost line is composed only of primes.
Note that in A089088, A373390, and this sequence, a(n) is coprime to zero, one and two previous terms, and the corresponding sequence terms are concentrated along two, three and four lines respectively.
The fixed points are 1, 2, 3, 8, 45, 51, and it is likely no 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(7) = 25 as 25 is the smallest unused number that is coprime to a(5) = 4 and a(6) = 9 while sharing a factor with a(4) = 5.
		

Crossrefs

Programs

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

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

A373938 Number of k in the range s(1), ..., s(n-1) such that gcd(k, s(n)) > 1, where s = A089088.

Original entry on oeis.org

0, 0, 1, 2, 1, 3, 2, 4, 1, 7, 6, 1, 6, 7, 11, 11, 8, 10, 1, 15, 4, 12, 1, 8, 15, 21, 15, 12, 16, 1, 10, 23, 18, 1, 14, 23, 29, 23, 20, 22, 1, 31, 6, 29, 18, 27, 35, 14, 31, 20, 28, 1, 43, 30, 1, 26, 31, 16, 45, 35, 24, 45, 47, 36, 1, 34, 39, 16, 53, 47, 26, 40, 1, 59, 20, 42, 1, 30, 47, 65, 18
Offset: 0

Views

Author

Scott R. Shannon, Jun 23 2024

Keywords

Comments

In the terms studied a(n) = 1 if s(n) is 4 or a prime.

Examples

			a(5) = 5 as A089088(5) = 8 and 8 shares a factor m > 1 with three previous terms, A089088(1) = 2, A089088(2) = 4, and A089088(3) = 6.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; s[0] = 1; s[1] = p = 2; s[2] = i = 4; s[3] = j = 6;
    Do[If[PrimeQ[j/2],
        k = Prime[p++],
        k = If[PrimeQ[j], i, j] + 1; While[PrimeQ[k], k++]];
      Set[{s[n], i, j}, {k, j, k}], {n, 4, nn}];
    s = Array[s, nn];
    {0}~Join~Table[Function[{m, w}, Count[w, _?(! CoprimeQ[#, m[[1]]] &)]] @@
    TakeDrop[#, -1] &@  s[[;; n]], {n, nn}] (* Michael De Vlieger, Jun 23 2024 *)
Showing 1-4 of 4 results.