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 17 results. Next

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

A381117 Lengths of runs of consecutive primes in A381019.

Original entry on oeis.org

5, 5, 2, 6, 6, 5, 10, 7, 7, 14, 11, 8, 12, 9, 18, 6, 17, 10, 17, 4, 21, 11, 20, 2, 19, 10, 34, 4, 15, 17, 17, 22, 16, 19, 25, 16, 2, 41, 3, 6, 41, 21, 24, 33, 8, 7, 46, 5, 54, 7, 48, 6, 7, 5, 41, 13, 31, 18, 5, 50, 1, 49, 10, 26, 41, 24, 45, 53, 20, 21, 44, 3
Offset: 1

Views

Author

N. J. A. Sloane, Feb 14 2025

Keywords

Comments

For n > 1, a(n) = A381116(n) - A381116(n-1) - 1. (This is a trivial consequence of the definitions.)

Crossrefs

Programs

  • Mathematica
    nn = 500; c[_] = False; i = 0; 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[i]; i = 0, i++];
        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 *)

A381119 Index of n in A381019.

Original entry on oeis.org

1, 2, 3, 7, 4, 23, 5, 16, 13, 47, 6, 36, 8, 79, 63, 64, 9, 142, 10, 100, 113, 123, 11, 167, 30, 223, 91, 196, 12, 290, 14, 256, 201, 325, 149, 442, 15, 364, 330, 405, 17, 485, 18, 530, 534, 630, 19, 583, 55, 682, 382, 735, 20, 790, 346, 847, 259, 1034, 21, 1095
Offset: 1

Views

Author

N. J. A. Sloane, Feb 14 2025

Keywords

Comments

Every number does eventually appear in A381019 (see that sequence for proof).

Crossrefs

Extensions

More terms from Alois P. Heinz, Feb 14 2025

A381120 Numbers k such that both A381019(k) and A381019(k+1) are composite.

Original entry on oeis.org

63, 630, 2423, 5653, 9104, 26308, 36108, 41622, 64526, 85121, 108917, 143913, 148305, 176405, 316974, 399168, 399907, 406487, 536926, 621016, 830793, 937038, 937109, 970243, 1088629, 1480545, 1895503, 3961587, 4651102, 5171081, 5487450, 6219705, 7327856, 8118740
Offset: 1

Views

Author

N. J. A. Sloane, Feb 15 2025

Keywords

Comments

Initially, A381019 consists of runs of primes separated by single composite numbers. These indices k mark the beginning of two or more consecutive composite numbers in A381019.

Crossrefs

Cf. A381019, A379810 (the values of A381019(k)).

Programs

  • PARI
    lista(nn) = my(c, f, m=1, q=1, r=0, t, u=List([]), w=vector(nn)); for(n=2, nn, t=0; forprime(p=2, max(m, sqrtint(n)), c=n-1-w[p]; if(c>1&&!w[c], listput(u, c))); listsort(u, 1); for(i=1, #u, c=u[i]; f=factor(c)[, 1]; t=1; for(j=1, #f, if(n-c<=w[f[j]], t=0; break)); if(t, u=u[i+1..#u]; if(r, print1(n-1, ", ")); r=1; w[c]=1; for(j=1, #f, w[f[j]]=n); m=max(m, f[#f]); break)); if(!t, r=0; u=List([]); if(nn>q=nextprime(q+1), w[q]=n))); \\ Jinyuan Wang, Feb 16 2025

Extensions

a(7)-a(8) from Michael De Vlieger, Feb 15 2025
a(9)-a(34) from Jinyuan Wang, Feb 16 2025

A379810 Composite numbers in A381019 which are immediately followed by another composite number, in order of their appearance.

Original entry on oeis.org

15, 46, 104, 305, 261, 1691, 380, 406, 508, 1175, 3281, 7729, 2827, 10877, 6289, 13289, 1737, 4829, 2945, 3205, 9673, 1940, 21253, 1970, 31921, 21127, 34861, 5457, 22219, 120983, 99893, 110843, 148613, 105029, 164107, 12905, 89279, 15245, 195617, 79909, 89827
Offset: 1

Views

Author

N. J. A. Sloane, Feb 15 2025

Keywords

Comments

Conjecture: For any k >= 1, A381019 contains k consecutive composite terms.
When is the first instance of three consecutive composite terms?

Crossrefs

Formula

a(n) = A381019(A381120(n)).

Extensions

a(6)-a(8) from Michael De Vlieger, Feb 15 2025
More terms from Jinyuan Wang, Feb 23 2025

A381118 Index of 2^n in A381019.

Original entry on oeis.org

1, 2, 7, 16, 64, 256, 975, 3856, 16647, 65039, 260112, 1044504, 4177980, 16777224
Offset: 0

Views

Author

N. J. A. Sloane, Feb 14 2025

Keywords

Comments

Every power of 2 appears in A381019 (see that entry for proof).

Crossrefs

Extensions

a(7) from Michael S. Branicky, Feb 14 2025
a(8) from Michael S. Branicky, Feb 15 2025
a(9)-a(13) from Jinyuan Wang, Feb 16 2025

A381222 Smallest number missing from A381019 after A381019(n) has been found.

Original entry on oeis.org

2, 3, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 18, 18, 18
Offset: 1

Views

Author

N. J. A. Sloane, Feb 19 2025

Keywords

Crossrefs

A381223 Take the list (A381222) of successive values of the smallest number missing from A381019, and keep just the first of any run of successive equal terms.

Original entry on oeis.org

2, 3, 4, 6, 10, 14, 18, 24, 26, 30, 34, 36, 42, 44, 45, 46, 50, 52, 54, 56, 58, 60, 66, 72, 76, 78, 84, 90, 96, 100, 102, 108, 110, 112, 114, 120, 122, 124, 126, 130, 136, 138, 144, 150, 156, 160, 162, 168, 170, 172, 174, 176, 180, 186, 188, 190, 192
Offset: 1

Views

Author

N. J. A. Sloane, Feb 20 2025

Keywords

Comments

All terms except 2 and 3 are composite numbers, although it is not obvious which composite numbers appear.

Examples

			A381222 begins 2, 3, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 10, 10, 10, ... and discarding terms which have already been seen we get 2, 3, 4, 6, 10, ...
		

Crossrefs

A382711 Regarding A381019 as a permutation of the natural numbers, this is the cycle with smallest term 8, read in the forward direction.

Original entry on oeis.org

8, 13, 9, 17, 41, 139, 677, 4651, 43037
Offset: 1

Views

Author

N. J. A. Sloane, Apr 06 2025

Keywords

Comments

A382712 shows the cycle containing 8 but read in the opposite direction. If this cycle turns out to be finite, both the present sequence and A382712 will be periodic, but if the cycle is infinite, the two sequences will never meet again.
A311019 has five finite cycles involving the numbers less than 8: (1), (2), (3), (4,5,7), and (6,11,23).

Crossrefs

Showing 1-10 of 17 results. Next