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.

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