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-10 of 10 results.

A351625 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that has not appeared that shares a factor with the largest previous term.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, May 04 2022

Keywords

Comments

The sequence differs from A352976 after twenty-six terms. See the examples below.
In the first 100000 terms the maximum run of even and odd terms is three and five respectively; it is unknown if these runs have a maximum number of terms or are unbounded. The fixed points beyond 2 are 15, 25, 35, and it is likely no more exist. The primes appear in their natural order, and it is conjectured that this is a permutation of the positive integers.
From Michael De Vlieger, May 08 2022: (Start)
Let u be the smallest missing number in a(1..n-1) and let record r = max(a(1..n-1)).
Theorem: For odd prime q, r = mq -> q. Proof: generally, q may either divide or be coprime to r, but since equality and coprimality are prohibited by definition, primes may only divide records. This implies q serves as local minima, hence u > 2 is always an odd prime and r > 1 is always even.
Since r is always even, r is nondecreasing and even numbers appear in natural order. Also, r = 2q -> q, similar to the Lagarias-Rains-Sloane chain in the EKG sequence but without the successor 3q.
Theorem: a(n) = k such that k is odd iff least prime factor q | k and q | r. Proof: sequence definition demands smallest missing number such that (r,k) > 1. Otherwise, a(n) = a(n-1) + 2, since (a(n-1), a(n-1) + 2) > 1, and all smaller even numbers have already appeared.
All even numbers and primes appear, and every odd composite k has a least prime factor that admits k into the sequence on the occasion of (r,k) > 1.
There are 3 trajectories in scatterplot for a(n) > 1. The trajectory with lowest apparent slope is that of the primes, i.e., local minima. The trajectory with highest slope is that of records, i.e., even numbers, and the remaining numbers are odd composites. (End)

Examples

			a(6) = 8 as the largest value of all previous terms is a(4) = 6, and 8 is the smallest unused number that shares a factor with 6.
a(27) = 32 as the largest value of all previous terms is a(24) = 30, and 32 is the smallest unused number that shares a factor with 30. Note that A352976(27) = 33 as it must share a factor with max(25,27) = 27.
		

Crossrefs

Programs

A351626 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that has not appeared that shares a factor with both the largest and second largest value of all previous terms.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 15, 22, 24, 26, 28, 30, 21, 32, 34, 36, 38, 40, 42, 35, 44, 33, 46, 48, 50, 45, 52, 54, 39, 56, 58, 60, 62, 64, 66, 68, 51, 70, 72, 63, 74, 76, 78, 57, 80, 65, 75, 82, 84, 86, 88, 90, 55, 92, 69, 94, 96, 98, 100, 102, 85, 104, 106, 108, 110, 99, 105, 112, 77
Offset: 1

Views

Author

Scott R. Shannon, May 04 2022

Keywords

Comments

The sequence contains no primes or prime powers other than the powers of 2. As the sequence starts with 2 and 4, these terms being the largest and second largest values, the following terms will be even. This pattern continues until a term equal to the product of two or more odd primes occurs that shares a factor with the previous two largest even values and is smaller than the largest value plus 2. It is not possible for this value to be a prime larger than 2, or a power of such a prime, as the two terms with which it must share a factor differ by 2. It therefore cannot be between them either so it must be less than the second largest even term. Thus the next term after this odd composite must still share a factor with the two largest even values, and this will be the largest value plus 2 or another smaller odd composite. Therefore two more even values eventually become the two largest terms again, and thus the pattern of the two largest even terms, differing by two, interrupted by odd composites continues. Therefore no primes or prime powers other than powers of 2 will occur.
In the first 200000 terms the maximum run of even and odd terms is twelve and seven respectively; it is unknown if these runs have a maximum number of terms or are unbounded. The fixed points beyond 2 in the same range are 573, 597, 633, 6487, 21865, 22115, although it is likely more exist.

Examples

			a(5) = 8 as the largest and second-largest values of all previous terms are a(4) = 6 and a(3) = 4, and 8 is the smallest unused number that shares a factor with both of these values.
a(12) = 15 as the largest and second-largest values of all previous terms are a(11) = 20 and a(10) = 18, and 15 is the smallest unused number that shares a factor with both of these values.
		

Crossrefs

A352943 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that has not appeared that shares a factor with the sum of the largest and second largest value of all previous terms.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, May 06 2022

Keywords

Comments

The sequence contains long runs on even terms, differing by 2, and odd terms, differing by various small even numbers. These runs are often interrupted by a large prime that becomes the new largest term. As this and the previous largest term are typically much larger than any other value the sequence then begins a long series of steadily increasing values that share a factor with the sum of these two largest terms.
The sequence is conjectured to be a permutation of the positive integers, although it apparently takes many terms for some primes to appear, e.g., after 200000 terms 73 has not occurred. The primes do not occur in their natural order. Beyond the first three terms there are nine fixed points in the first 200000 terms, although it is likely more exist.

Examples

			a(4) = 5 as the sum of the largest and second-largest value of all previous terms is a(3) + a(2) = 3 + 2 = 5, and 5 is the smallest unused number that shares a factor with 5.
a(10) = 8 as the sum of the largest and second-largest value of all previous terms is a(8) + a(7) = 17 + 11 = 28, and 8 is the smallest unused number that shares a factor with 28.
		

Crossrefs

Programs

A352968 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that has not appeared that shares a factor with min(a(n-2),a(n-1)).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Apr 12 2022

Keywords

Comments

Although all primes likely appear they do not occur in their natural order, e.g., 17 appears before 13. In the range studied each time a prime appears, beyond the initial 2 and 3, the next term is a multiple of the same prime. The largest multiple in the first 500000 terms is eight, first occurring at a(446271) = 64403, a(446272) = 515224. It is unknown if this ratio is unbounded for large n. Similarly the smaller of the two terms before a prime is a multiple of the prime. The largest ratio found being seven, first occurring at a(446271) = 64403, the same term as above.
In the first 500000 terms there are thirty-eight fixed points - 1, 2, 3, 4, 14, 32, 85, ..., 3277, 8651, 9223. It is likely no more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(4) = 4 as min(a(2),a(3)) = min(2,3) = 2, and 4 is the smallest unused number that shares a factor with 2.
a(5) = 6 as min(a(3),a(4)) = min(3,4) = 3, and 6 is the smallest unused number that shares a factor with 3.
		

Crossrefs

Programs

A352976 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that has not appeared that shares a factor with max(a(n-2),a(n-1)).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Apr 13 2022

Keywords

Comments

Although all primes likely appear they do not occur in their natural order, e.g., 37 appears before 31. In the range studied each time a prime appears, beyond the initial 2, the previous term is a multiple of the same prime. The largest multiple in the first 500000 terms is six, first occurring at a(7782) = 8286, a(7783) = 1381. It is unknown if this ratio is unbounded for large n. As a prime term is less than its previous term the term following the prime will share a factor with previous multiple of the prime. This factor appears to always be a factor of the multiple and thus the term is not another multiple of the prime.
In the first 500000 terms the fixed points are 1, 2, 15, 25, 35. It is likely no more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(4) = 6 as max(a(2),a(3)) = max(2,4) = 4, and 6 is the smallest unused number that shares a factor with 4.
a(5) = 3 as max(a(3),a(4)) = max(4,6) = 6, and 3 is the smallest unused number that shares a factor with 6.
		

Crossrefs

Programs

A353239 Lexicographically earliest infinite sequence of distinct positive numbers such that, for n > 2, a(n) has either a common factor with a(n-1) but not with a(n-2), or with a(n-2) but not with a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Apr 08 2022

Keywords

Comments

This sequence is a hybrid of the selection rules of the Yellowstone permutation A098550 and the Enots Wolley sequence A336957. As in the latter, to ensure the sequence is infinite an additional rule is applied: a(n) cannot have the same set of prime divisors as a(n-1).
Like the EKG sequence A064413, the primes p appear in natural order, and 2p precedes p. However, unlike A064413, the term following p is not 3p, but rather a term close to 2p, typically 2p+2.
The sequence is conjectured to be a permutation of the positive integers. Because of the selection rule at most two consecutive terms can be even, although the number of consecutive odd terms is likely arbitrarily large.
In the first 100000 terms the fixed points are 1,2,3,4,12. It is likely no more exist.

Examples

			a(4) = 4 as a(2) = 2, a(3) = 3, and 4 is the smallest unused number that has a common factor with 2 but not with 3.
a(5) = 9 as a(3) = 3, a(4) = 4, and 9 is the smallest unused number that is coprime to 4 but not to 3. Note that 8 also meets the selection criteria, but its only prime factor, 2, is shared with a(4) = 4, so 8 cannot be chosen as a(5) because then a(6) would not exist.
		

Crossrefs

Programs

  • MATLAB
    function a = A353239( max_n )
        a = [1 2 3];
        m = [1:max_n];
        b = cell(1,max_n); b{1} = [1]; b{2} = [2]; b{3} = [3];
        for n = 4:max_n
            j = 4; k = m(j); f = factor(k);
            while ((isempty(intersect(b{n-2},f)) ~= ~isempty(intersect(b{n-1},f)))...
                    ||isequal(unique(b{n-1}),unique(f)))
                j = j+1;
                k = m(j);
                f = factor(k);
            end
            a(n) = k;
            b{n} = f;
            m(m==k) = []; m(end+1) = m(end)+1;
        end
    end % Thomas Scheuerle, Apr 12 2022

A377078 Lexicographically earliest infinite sequence of distinct positive integers such that, for n > 2, a(n) shares a factor with a(n-2) mod a(n-1).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Oct 15 2024

Keywords

Comments

To ensure the sequence is infinite a(n) must be chosen so that a(n-1) mod a(n) is not 0 or 1. In the first 100000 terms the fixed points are 119, 205, 287, and it is likely no more exist. It is conjectured all numbers > 1 appear in the sequence.

Examples

			a(4) = 6 as a(2) mod a(3) = 3 mod 4 = 3, and 6 is the earliest unused number that shares a factor with 3.
a(12) = 16 as a(10) mod a(11) = 14 mod 15 = 14, and 16 shares a factor with 14. Note that 7 is unused and shares a factor with 14 but a(11) mod 7 = 1, so choosing a(12) = 7 would mean a(13) would not exist.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 2; a[2] = 3; hs = {a[1], a[2]}; pool = Range[4, 1000];
    a[n_] := a[n] = Module[{m, pos}, pool = Complement[pool, hs];m = Mod[a[n - 2], a[n - 1]]; pos = FirstPosition[pool, _?(Mod[a[n - 1], #] > 1 && GCD[#, m] > 1 &)][[1]]; AppendTo[hs, pool[[pos]]]; pool[[pos]]]
    Array[a, 90, 1] (* Shenghui Yang, Oct 16 2024*)
  • Python
    from math import gcd
    from itertools import count, islice
    def agen(): # generator of terms
        an2, an1, aset, m = 2, 3, {2, 3}, 4
        yield from [2, 3]
        while True:
            t = an2%an1
            an = next(k for k in count(m) if k not in aset and an1%k > 1 and gcd(k, t) > 1)
            yield an
            aset.add(an)
            while m in aset: m += 1
            an2, an1 = an1, an
    print(list(islice(agen(), 90))) # Michael S. Branicky, Oct 15 2024

A337181 a(1) = 1, a(2) = 2; for n>2, a(n) is the smallest number not already used that is a multiple of at least one prime factor of both a(n-1) and a(n-2).

Original entry on oeis.org

1, 2, 4, 8, 12, 6, 9, 18, 24, 16, 20, 10, 25, 30, 15, 27, 36, 42, 14, 21, 28, 48, 32, 40, 44, 22, 52, 26, 56, 60, 35, 45, 50, 54, 64, 66, 68, 34, 72, 51, 63, 81, 84, 78, 39, 90, 65, 70, 75, 80, 96, 76, 38, 88, 92, 46, 100, 104, 108, 102, 99, 33, 117, 126, 91, 49, 98, 112, 116, 58, 120
Offset: 1

Views

Author

Scott R. Shannon, Jan 28 2021

Keywords

Comments

As each term must have at least two prime factors no term, other than the initial 2, can be prime.

Examples

			a(4) = 8 as the factors of a(4-2) = a(2) = 2 and a(4-1) = a(3) = 4 = 2*2, thus a(4) must be the minimum unused multiple of 2*2 = 4, which is 8.
a(6) = 6 as the factors of a(6-2) = a(4) = 8 = 2*2*2 and a(6-1) = a(5) = 12 = 2*2*3, thus a(4) must be the minimum unused multiple of 2*2 = 4 or 2*3 = 6. As 4 has been used a(6) = 6.
a(13) = 25 as the factors of a(13-2) = a(11) = 20 = 2*2*5 and a(13-1) = a(12) = 10 = 2*5, thus a(13) must be the minimum unused multiple of 2*2 = 4, 2*5 = 10, or 5*5 = 25. As 4,8,10,12,16,20,24 have been used, a(13) = 25.
		

Crossrefs

A377182 Lexicographically earliest infinite sequence of distinct positive integers such that, for n > 2, a(n) shares a factor with a(n-2) mod a(n-1) while a(n-1) mod a(n) has not previously occurred as the mod value for any consecutive pair of terms.

Original entry on oeis.org

2, 3, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 26, 27, 28, 30, 32, 25, 35, 40, 42, 44, 33, 55, 36, 38, 39, 34, 45, 46, 48, 50, 51, 52, 54, 56, 57, 58, 60, 62, 63, 64, 66, 68, 69, 70, 72, 49, 92, 98, 100, 102, 65, 74, 75, 76, 78, 80, 81, 82, 84, 86, 87, 88, 90, 77, 91, 99, 104, 105, 106, 108, 110, 93, 119, 120, 126, 85, 123, 125, 96, 116, 117, 118, 129, 130
Offset: 1

Views

Author

Scott R. Shannon, Oct 18 2024

Keywords

Comments

To ensure the sequence is infinite a(n) must be chosen so that a(n-1) mod a(n) is not 0 or 1. Care must also be taken when choosing a(n) if it is equal to any previously occurring mod value as one is not then guaranteed the next term will exist - in such cases smaller unused mod values must be checked for a valid next term, otherwise the term must be rejected and the next largest candidate trialled.
Surprisingly the first prime to occur is a(94122) = 47857. The next is a(103105) = 26591, and no other primes appear in the first 500000 terms. It is unknown if more occur or why it takes so many terms for a prime to appear. Many small primes, like 5, can never occur as all mod values less than the prime have already appeared. It is conjectured all missing numbers are prime.
In the first 500000 terms the fixed points are 111, 533, 649, 11957; it is unknown if more exist.
Keyword "look" refers to Scott Shannon's image of 100000 terms. - N. J. A. Sloane, Oct 19 2024

Examples

			a(4) = 6 as a(2) mod a(3) = 3 mod 4 = 3, and 6 is the earliest unused number that shares a factor with 3 while 3 has not occurred as a mod value for any previous pair.
a(9) = 14 as a(7) mod a(8) = 10 mod 12 = 10, and 14 factor with 10. Note that 5 is unused and shares a factor with 10 but a(8) mod 5 = 12 mod 5 = 2, but 2 has previously occurred as the mod value for a(1) mod a(2), so 5 cannot be used. This is the first term to differ from A377078.
		

Crossrefs

Programs

  • Mathematica
    nn = 120;
    c[] := False; m[] := False;
    Array[Set[{a[#], c[# + 1]}, {# + 1, True}] &, 2];
    Set[{i, j, v}, {a[1], a[2], 2}];
    mj = Mod[i, j]; Array[Set[m[#], True] &, mj + 1, 0];
    Do[k = v;
      While[Set[mk, Mod[j, k]]; Or[c[k], m[mk], m[k], CoprimeQ[mj, k]], k++];
      While[m[v], v++];
      Set[{a[n], c[k], m[mk], i, j, mj}, {k, True, True, j, k, mk}], {n, 3, nn}];
    Array[a, nn] (* Michael De Vlieger, Oct 19 2024 *)

A377236 The mod value of the consecutive pairs of terms in A377182.

Original entry on oeis.org

2, 3, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 26, 27, 28, 30, 7, 25, 35, 40, 42, 11, 33, 19, 36, 38, 5, 34, 45, 46, 48, 50, 51, 52, 54, 56, 57, 58, 60, 62, 63, 64, 66, 68, 69, 70, 23, 49, 92, 98, 100, 37, 65, 74, 75, 76, 78, 80, 81, 82, 84, 86, 87, 88, 13, 77, 91, 99, 104, 105, 106, 108, 17, 93, 119, 120, 41, 85, 123, 29, 96, 116, 117, 118, 129
Offset: 1

Views

Author

Scott R. Shannon, Oct 21 2024

Keywords

Comments

See A377182 for further details.
It is conjectured the sequence contains all numbers > 1.

Crossrefs

Showing 1-10 of 10 results.