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

A359256 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number which has not appeared such that all the distinct prime factors of a(n-1) + a(n) are factors of a(n).

Original entry on oeis.org

1, 2, 6, 3, 24, 8, 56, 42, 7, 336, 48, 16, 112, 84, 12, 4, 28, 21, 60, 15, 10, 22, 66, 30, 18, 9, 72, 36, 45, 80, 20, 5, 120, 40, 85, 204, 39, 78, 26, 38, 90, 35, 14, 50, 75, 150, 93, 186, 57, 114, 102, 34, 94, 162, 54, 27, 216, 108, 135, 240, 144, 99, 198, 44, 77, 266, 95, 380, 132, 110, 11
Offset: 1

Views

Author

Scott R. Shannon and Eric Angelini, Jan 05 2023

Keywords

Comments

The primes do not occur in their natural order, and for all terms studied if a(n) is a prime p, then a(n-1) = p(p-1) and a(n+1) = p(p^2-1). In the first 10000 terms the fixed points are 22, 165, 710, 1005, 9003, although it is likely more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(3) = 6 as a(2) + 6 = 2 + 6 = 8 which has 2 as its only distinct prime factor, and 2 is a factor of 6.
a(8) = 42 as a(7) + 42 = 56 + 42 = 96 which has 2 and 3 as distinct prime factors,  and 2 and 3 are factors of 42.
a(10) = 336 as a(9) + 336 = 7 + 336 = 343 which has 7 as its only distinct prime factor, and 7 is a factor of 336. Note that 336 = 7(7^2-1).
		

Crossrefs

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

A360209 Lexicographically earliest infinite sequence of distinct positive numbers such that, for n > 2, a(n) shares a factor with a(n-2) + a(n-1) but shares no factor with a(n-2).

Original entry on oeis.org

1, 2, 3, 5, 4, 6, 15, 7, 8, 9, 17, 10, 12, 11, 23, 14, 37, 27, 16, 43, 59, 18, 21, 13, 20, 22, 33, 25, 26, 24, 35, 295, 32, 36, 51, 29, 28, 19, 47, 30, 44, 259, 39, 34, 73, 107, 38, 40, 45, 119, 41, 46, 42, 55, 97, 48, 50, 49, 57, 52, 109, 63, 54, 65, 77, 56, 76, 69, 75, 58, 91, 149, 60, 66
Offset: 1

Views

Author

Scott R. Shannon, Jan 29 2023

Keywords

Comments

To ensure the sequence is infinite another criterion must be satisfied when choosing a(n), namely a(n) + a(n-1) must contain a factor not in a(n-1). If this were not the case, a(n+1) = a(n) + a(n-1) would share a factor with both a(n) + a(n-1) and a(n-1), terminating the sequence.
In the first 100000 terms the fixed points for n > 2 are 3, 6, 441, 1677, 3629, 9701, 17131, although it is likely more exist. The sequence is conjectured to be a permutation of the positive integers.

Examples

			a(7) = 15 as a(5) + a(6) = 4 + 6 = 10, and 15 is the smallest positive unused number that shares a factor with 10 but not with a(5) = 4.
a(41) = 44 as a(39) + a(40) = 47 + 30 = 77, and 44 shares a factor with 77 but not with a(39) = 47. Note that 42 also satisfies these criteria but 30 + 42 = 72 which shares all its factors with a(40) = 30, thus setting a(41) = 42 would make it impossible to find a(42).
		

Crossrefs

Cf. A251604 (does not share with a(n-1)), A098550, A336957, A337136, A359557, A353239.

Extensions

a(6) and above corrected by Scott R. Shannon, Mar 17 2023

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 *)

A359857 a(1) = 1, a(2) = 2, and let i,j represent a(n-2), a(n-1) respectively. For n > 2: If only one of i,j is prime, a(n) = least novel multiple of i+j. If i,j are both prime, a(n) = least novel multiple of i*j. If both i,j are nonprime, a(n) is least novel k prime to both i and j.

Original entry on oeis.org

1, 2, 3, 6, 9, 5, 14, 19, 33, 52, 7, 59, 413, 472, 11, 483, 494, 17, 511, 528, 13, 541, 7033, 7574, 15, 23, 38, 61, 99, 160, 29, 189, 218, 25, 21, 4, 31, 35, 66, 37, 103, 3811, 3914, 27, 41, 68, 109, 177, 286, 43, 329, 372, 53, 425, 478, 39, 47, 86, 133, 45, 8
Offset: 1

Views

Author

David James Sycamore, Jan 16 2023

Keywords

Comments

A lexicographically earliest sequence. If the "least novel" restrictions on the first two conditions are removed the result is a sequence initially identical to this one, but eventually repeat terms occur, whereas in this constrained version there are no repeats. The plots appear to distinguish three distinct zones, corresponding to the conditions of the Name. The first (upper) relates to terms following the occurrence of two primes (i*j), the middle zone relates to the occurrence of a prime and a nonprime (i+j), and the third (lowest) refers to terms following the occurrence of consecutive nonprime terms, where the coprime condition introduces the least unused numbers, which are initially (until a(25) = 15) all primes. It is not clear if every positive integer appears, but this does seem likely (note the late appearance of 4 at a(36)).

Examples

			a(3) = 3 since only one of a(1), a(2) is prime and i+j = 3 has not occurred previously.
a(4) = 6 since a(2) = 2 and a(3) = 3 are both prime and i*j = 6 has not occurred previously.
a(6) = 5 since a(4) = 6 and a(5) = 9 are both composite, and 5 is the least novel number prime to both.
		

Crossrefs

Programs

  • Python
    from math import gcd
    from sympy import isprime
    from itertools import count, islice
    def agen():
        i, j, pi, pj, mink, aset = 1, 2, 0, 1, 3, {1, 2}
        yield from [i, j]
        while True:
            if pi^pj:
                k, m = max(mink//(i+j), 1), i+j
                while m*k in aset: k += 1
            elif pi&pj:
                k, m = max(mink//(i*j), 1), i*j
                while m*k in aset: k += 1
            else:
                k, m = mink, 1
                while k in aset or gcd(k, i) != 1 or gcd(k, j) != 1: k += 1
            an = m*k
            i, j, pi, pj = j, an, pj, int(isprime(an)); yield an; aset.add(an)
            while mink in aset: mink += 1
    print(list(islice(agen(), 36))) # Michael S. Branicky, Jan 16 2023

Extensions

a(31)=29 inserted and a(38) and beyond from Michael S. Branicky, Jan 16 2023

A360931 a(1) = 2, a(2) = 3; for n > 2, a(n) is the smallest number greater than 1 that has not appeared such that |a(n) - a(n-1)| has a common factor with a(n-2).

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Feb 25 2023

Keywords

Comments

In the first 100000 terms the fixed points are 10, 16, 42, 52, 66; it is likely no more exist. The sequence is conjectured to be a permutation of the positive integers > 1.

Examples

			a(6) = 7 as |7 - a(5)| = |7 - 13| = 6 which shares a common factor with a(4) = 8.
		

Crossrefs

Programs

A361593 a(1) = 1, a(2) = 2, a(3) = 3; for n > 3, a(n) is the smallest positive number which has not appeared such that all the distinct prime factors of a(n-3) + a(n-2) + a(n-1) are factors of a(n).

Original entry on oeis.org

1, 2, 3, 6, 11, 10, 9, 30, 7, 46, 83, 34, 163, 70, 267, 20, 357, 322, 699, 1378, 2399, 2238, 6015, 5326, 13579, 6230, 25135, 106, 31471, 14178, 45755, 15234, 75167, 68078, 8341, 151586, 228005, 193966, 573557, 248882, 1016405, 306474, 1571761, 361830, 2240065, 1043414, 3645309, 3464394
Offset: 1

Views

Author

Keywords

Comments

This is a variation of A359557 where the previous three terms are added instead of two. Unlike A359557 the terms here do no rapidly reach a regime where all terms share one or more prime factors, and it is unknown if this ever occurs.

Examples

			a(6) = 10 as a(3) + a(4) + a(5) = 3 + 6 + 11 = 20 = 2*2*5, and the smallest unused number containing 2 and 5 as factors is 10.
		

Crossrefs

Programs

  • Mathematica
    nn = 120; c[] = False; q[] = 1;
    f[n_] := Times @@ FactorInteger[n][[All, 1]]; t = 3;
    Array[Set[{a[#], c[#]}, {#, True}] &, t]; Set[{i, j, k, x}, {a[t - 2],
       a[t - 1], a[t], f[a[t - 2] + a[t - 1] + a[t]]}];
    Do[m = q[x];
      While[c[x m], m++];
      m *= x; While[c[x q[x]], q[x]++];
      Set[{a[n], c[m], i, j, k, x}, {m, True, j, k, m, f[j + k + m]}], {n,
    t + 1, nn}]; Array[a, nn] (* Michael De Vlieger, Mar 20 2023 *)

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