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.

Previous Showing 11-14 of 14 results.

A379248 a(1) = 1, a(2) = 2, for a(n) > 2, a(n) is the smallest unused positive number that shares a factor with a(n-1) while no exponent of each distinct prime factor of a(n) is the same as the exponent of the same prime factor of a(n-1).

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 9, 3, 18, 15, 25, 5, 50, 16, 14, 20, 22, 24, 26, 28, 30, 27, 21, 36, 32, 34, 40, 38, 44, 42, 45, 33, 54, 39, 63, 48, 46, 52, 56, 49, 7, 98, 35, 75, 55, 100, 58, 60, 62, 64, 66, 68, 70, 72, 51, 81, 57, 90, 69, 99, 78, 76, 74, 80, 82, 84, 86, 88, 92, 94, 96, 104, 102, 108, 87, 117, 93, 126, 111, 135, 114, 112, 106, 116, 110, 121, 11, 242
Offset: 1

Views

Author

Scott R. Shannon, Dec 18 2024

Keywords

Comments

For the terms studied the primes appear as terms in their natural order, and when a prime p appears as a term, the preceding term is always p^2 and the following term is always 2*p^2; it is likely this is true for all primes. A similar pattern is seen in the EKG sequence A064413 except that there a prime is always preceded by 2*p and followed by 3*p.
Unlike the EKG sequence a prime can appear as a factor of a preceding term long before it appears as a term by itself - see A379291 for the indices where each prime first appears as a factor of a(n).
The indices where the primes appear show an interesting pattern of runs of consecutive primes that are separated by only 6 terms, with longer, sometimes much longer, gaps in between - see A379290 and A379296. These primes appear in regions where the terms overall show a strong oscillating pattern of jumping between terms containing a prime p and p^2 as a factor. The primes being oscillated between increase until a new prime q appears in a term q^2 which leads to the next term being q. The occurrence of a new prime q can start a run of consecutive primes appearing before these oscillations subside and the terms slowly grow again until the next oscillation. See the attached graphs which show the burst/oscillating behavior, with the primes appearing in these regions, followed by terms with a slow, more linear, growth.
In the first 500000 terms there are only six fixed points - see A379292. However, as the regions of oscillating terms crosses the a(n) = n line it is likely more exist for larger values of n.
The sequence is conjectured to be a permutation of the positive integers. See A379293 for the index where n first appears.

Examples

			a(3) = 4 as 4 is unused and shares a factor with a(2) = 2, while 4 = 2^2 which has 2 as the exponent of the prime 2, while a(2) = 2^1 which has exponent 1. As these are different 4 is acceptable.
a(5) = 8 as 8 is unused and shares a factor with a(4) = 6, while 8 = 2^3 which has 3 as the exponent of the prime 2, while a(4) = 2^1*3^1 which has exponent 1. As these are different 8 is acceptable. Note that although 3 shares a factor with 6, 3 = 3^1 which has the same exponent 1 on the prime 3 as 6 = 2^1*3^1, so 3 cannot be chosen. This is the first term to differ from A064413.
		

Crossrefs

Cf. A379290 (index where prime n appears as a term), A379296 (differences between indices where prime terms appear), A379291 (index where prime n first appears as a factor of a(n)), A379293 (index where n appears as a term), A379292 (fixed points), A379294 (record high values), A379295 (indices of record high values).

Programs

  • Mathematica
    nn = 120; c[_] := False;
    f[x_] := f[x] = FactorInteger[x]; j = 2; u = 3;
    {1, 2}~Join~Reap[Do[
      k = u; While[Or[c[k], CoprimeQ[j, k], AnyTrue[f[k], MemberQ[f[j], #] &]], k++];
        Set[{j, c[k]}, {k, True}]; Sow[k];
    If[k == u, While[c[u], u++]], {n, 3, nn}] ][[-1, 1]] (* Michael De Vlieger, Dec 21 2024 *)
  • Python
    from sympy import factorint
    from itertools import islice
    from collections import Counter
    fcache = dict()
    def myfactors(n):
        global fcache
        if n in fcache: return fcache[n]
        ans = Counter({p:e for p, e in factorint(n).items()})
        fcache[n] = ans
        return ans
    def agen(): # generator of terms
        yield 1
        an, a, m = 2, {1, 2}, 3
        while True:
            yield an
            k, fan = m-1, myfactors(an)
            sfan = set(fan)
            while True:
                k += 1
                if k in a: continue
                fk = myfactors(k)
                sfk = set(fk)
                if sfk & sfan and all(fk[p]!=fan[p] for p in sfan):
                    an = k
                    break
            a.add(an)
    print(list(islice(agen(), 89))) # Michael S. Branicky, Jan 05 2025

A375563 a(1) = 1; for n > 1, a(n) is the smallest unused positive number that shares a factor with a(n-1) if a(n-1) is prime, otherwise a(n) is coprime to a(n-1).

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 10, 7, 14, 9, 8, 11, 22, 13, 26, 15, 16, 17, 34, 19, 38, 21, 20, 23, 46, 25, 12, 29, 58, 27, 28, 31, 62, 33, 32, 35, 18, 37, 74, 39, 40, 41, 82, 43, 86, 45, 44, 47, 94, 49, 24, 53, 106, 51, 50, 57, 52, 55, 36, 59, 118, 61, 122, 63, 64, 65, 42, 67, 134, 69, 56, 71, 142, 73, 146
Offset: 1

Views

Author

Scott R. Shannon, Aug 19 2024

Keywords

Comments

The terms are all concentrated along three lines with the central line, consisting entirely of all the odd terms, along the line a(n) = n. Surprisingly however there are no fixed points in the first 100000 terms. In the same range the primes appear in their natural order. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(6) = 5 as a(5) = 6 is a composite number, and 5 is the smallest unused number that is coprime to 6.
		

Crossrefs

A377157 a(n) = n for n <= 3; for n > 3, a(n) is the smallest unused positive number that is coprime to a(n-1) if a(n-1) is prime and coprime to a(n-2) if a(n-2) is prime, else a(n) shares a factor with a(n-1) and a(n-2) if both are composite.

Original entry on oeis.org

1, 2, 3, 5, 4, 6, 8, 10, 12, 14, 16, 18, 20, 15, 24, 9, 21, 27, 30, 33, 22, 11, 7, 13, 17, 19, 23, 25, 26, 40, 28, 32, 34, 36, 38, 42, 44, 46, 48, 50, 45, 35, 55, 60, 65, 39, 52, 54, 56, 58, 62, 64, 66, 68, 51, 72, 57, 63, 69, 75, 78, 70, 74, 76, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 85, 105, 95, 110, 114, 99, 81, 87, 93, 108, 111, 117, 120, 104
Offset: 1

Views

Author

Scott R. Shannon, Oct 18 2024

Keywords

Comments

Similar to A375564 the primes appear in clusters separated by runs of composites. However unlike A375564 the runs of primes are interrupted by occasional composites, typically toward the end of the run - see the attaching image of the first 5000 terms. The first prime in the runs can also be larger than one or more subsequent primes, so unlike A375564, the primes do not all occur in their natural order; in the first 3000000 terms the out-of-order primes are 11 and 3581.
The runs of primes also appear to occur much less frequently than in A375564 - the last known run begins at a(156233) = 3581 and ends at a(169394) = 146857, and no more primes appear up to 3000000 terms.
The fixed points begin 1, 2, 3, 6, 32, 57, 119, 343, 3123, 3859, 120481. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(5) = 4 as both a(3) = 3 and a(4) = 5 are prime so a(5) must be coprime to both, and 4 is the smallest unused number coprime to both 3 and 5.
a(6) = 6 as a(4) = 5 is prime so a(6) must be coprime to a(4), and 6 is the smallest unused number coprime to 5.
a(7) = 8 as both a(5) = 4 and a(6) = 6 are composite so a(7) must share a factor with both, and 8 is the smallest unused number that shares a factor with both 4 and 6.
		

Crossrefs

A384045 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest unused positive number that shares a factor with a(n-1) if it is greater than it, else it is coprime to a(n-1) if it is less than it.

Original entry on oeis.org

1, 2, 4, 3, 6, 5, 10, 7, 14, 9, 8, 12, 11, 22, 13, 26, 15, 18, 17, 16, 20, 19, 38, 21, 24, 23, 46, 25, 30, 29, 27, 33, 28, 32, 31, 62, 35, 34, 36, 39, 37, 74, 41, 40, 42, 44, 43, 86, 45, 48, 47, 94, 49, 56, 51, 50, 52, 54, 53, 106, 55, 60, 59, 57, 63, 58, 64, 61
Offset: 1

Views

Author

Scott R. Shannon, May 18 2025

Keywords

Comments

For the terms studied all primes appear in their natural order, and approximately 65% of all primes p are immediately followed by a term 2*p. These later terms form the upper of the two lines in the graph.
In the first 100000 terms the fixed points are 1, 2, 12, 18, 98, 182, 306, 380; it is likely no more exist.
The sequence is a permutation of the positive integers as the lowest unused number after k terms will always appear as it will eventually be coprime to a(j) for some j > k.

Examples

			a(3) = 4 as a(2) = 2 and 4 > 2 and shares a factor with it. Note 3 cannot be chosen as 3 > 2 but is coprime to 2.
a(4) = 3 as a(3) = 4 and 3 < 4 and is coprime to it.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[_] := False; j = 2; u = 3; c[1] = c[2] = True;
    {1, 2}~Join~Reap[Do[k = u;
      While[And[k < j, Or[c[k], ! CoprimeQ[j, k]]], k++];
        If[k >= j,
          If[PrimePowerQ[j],
            Set[{p, k}, {FactorInteger[j][[1, 1]], 1}]; While[c[k*p], k++]; k *= p,
            While[Or[c[k], CoprimeQ[j, k]], k++] ] ];
        Sow[k]; Set[{c[k], j}, {True, k}];
        If[k == u, While[c[u], u++]],
    {n, 3, nn}] ][[-1, 1]] (* Michael De Vlieger, May 27 2025 *)
Previous Showing 11-14 of 14 results.