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

A381116 Indices of composite terms in A381019.

Original entry on oeis.org

7, 13, 16, 23, 30, 36, 47, 55, 63, 64, 79, 91, 100, 113, 123, 142, 149, 167, 178, 196, 201, 223, 235, 256, 259, 279, 290, 325, 330, 346, 364, 382, 405, 422, 442, 468, 485, 488, 530, 534, 541, 583, 605, 630, 631, 665, 674, 682, 729, 735, 790, 798, 847, 854, 862
Offset: 1

Views

Author

N. J. A. Sloane, Feb 14 2025

Keywords

Crossrefs

Programs

  • Mathematica
    nn = 1000; c[_] = False; u = v = 2; a[1] = 1;
    Monitor[Reap[
      Do[k = u;
        While[Or[c[k],
          ! CoprimeQ[k, Product[a[h], {h, n - Min[k, n - 1], n - 1}] ] ],
          If[k > n - 1, k = v, k++]];
        Set[{a[n], c[k]}, {k, True}];
        If[CompositeQ[k], Sow[n]];
        If[k == u, While[c[u], u++]];
    If[k == v, While[Or[c[v], CompositeQ[v]], v++]], {n, 2, nn}] ][[-1, 1]], n] (* Michael De Vlieger, Feb 14 2025 *)
  • Python
    from math import gcd
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        alst, aset, an, m = [1], {1}, 1, 2
        for n in count(2):
            if an > 3 and not isprime(an):
                yield n-1
            an = next(k for k in count(m) if k not in aset and all(gcd(alst[-j], k) == 1 for j in range(1, min(k, n-1)+1)))
            alst.append(an)
            aset.add(an)
            while m in aset: m += 1
    print(list(islice(agen(), 55))) # Michael S. Branicky, Feb 14 2025

A381115 Composite terms in A381019 in order of appearance.

Original entry on oeis.org

4, 9, 8, 6, 25, 12, 10, 49, 15, 16, 14, 27, 20, 21, 22, 18, 35, 24, 169, 28, 33, 26, 85, 32, 57, 77, 30, 34, 39, 55, 38, 51, 40, 91, 36, 121, 42, 65, 44, 45, 529, 48, 119, 46, 95, 81, 143, 50, 63, 52, 54, 115, 56, 841, 187, 69, 62, 125, 87, 64, 133, 75, 58, 221
Offset: 1

Views

Author

N. J. A. Sloane, Feb 14 2025

Keywords

Crossrefs

Programs

  • Mathematica
    nn = 500; c[_] = False; u = v = 2; a[1] = 1;
    Monitor[Reap[
      Do[k = u;
        While[Or[c[k],
          ! CoprimeQ[k, Product[a[h], {h, n - Min[k, n - 1], n - 1}] ] ],
          If[k > n - 1, k = v, k++]];
        Set[{a[n], c[k]}, {k, True}];
        If[CompositeQ[k], Sow[k]];
        If[k == u, While[c[u], u++]];
    If[k == v, While[Or[c[v], CompositeQ[v]], v++]], {n, 2, nn}] ][[-1, 1]], n] (* Michael De Vlieger, Feb 14 2025 *)
  • Python
    from math import gcd
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        alst, aset, an, m = [1], {1}, 1, 2
        for n in count(2):
            if an > 3 and not isprime(an):
                yield an
            an = next(k for k in count(m) if k not in aset and all(gcd(alst[-j], k) == 1 for j in range(1, min(k, n-1)+1)))
            alst.append(an)
            aset.add(an)
            while m in aset: m += 1
    print(list(islice(agen(), 64))) # Michael S. Branicky, Feb 14 2025

A381616 a(n) is the smallest prime that starts the first occurrence of exactly n consecutive primes in A381019.

Original entry on oeis.org

7643, 31, 3517, 1049, 2, 41, 173, 401, 523, 113, 337, 449, 6599, 251, 1993, 2543, 743, 593, 1481, 1301, 1069, 2357, 17657, 4079, 2797, 8219, 64123, 81299, 19289, 40129, 6709, 13999, 4271, 1669, 37579, 28793, 38039, 12413, 125711, 24907, 3181, 41597, 27253
Offset: 1

Views

Author

Gonzalo Martínez, Mar 01 2025

Keywords

Comments

As the sequence grows, increasingly longer chains of consecutive prime numbers begin to appear.
Conjecture: a(n) always exists.

Examples

			For n = 2, we observe that 9, 31, 37, and 8 are four consecutive terms of A381019, where 31 and 37 are exactly two consecutive primes and represent the first occurrence of two consecutive terms that are prime. So, a(2) = 31.
		

Crossrefs

Showing 1-3 of 3 results.