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.

This page as a plain text file.
%I A381117 #10 Feb 14 2025 10:19:53
%S A381117 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,
%T A381117 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,
%U A381117 5,41,13,31,18,5,50,1,49,10,26,41,24,45,53,20,21,44,3
%N A381117 Lengths of runs of consecutive primes in A381019.
%C A381117 For n > 1, a(n) = A381116(n) - A381116(n-1) - 1. (This is a trivial consequence of the definitions.)
%t A381117 nn = 500; c[_] = False; i = 0; u = v = 2; a[1] = 1;
%t A381117 Monitor[Reap[
%t A381117   Do[k = u;
%t A381117     While[Or[c[k],
%t A381117       ! CoprimeQ[k, Product[a[h], {h, n - Min[k, n - 1], n - 1}] ] ],
%t A381117     If[k > n - 1, k = v, k++]];
%t A381117     Set[{a[n], c[k]}, {k, True}];
%t A381117     If[CompositeQ[k], Sow[i]; i = 0, i++];
%t A381117     If[k == u, While[c[u], u++]];
%t A381117 If[k == v, While[Or[c[v], CompositeQ[v]], v++]], {n, 2, nn}] ][[-1, 1]], n] (* _Michael De Vlieger_, Feb 14 2025 *)
%Y A381117 Cf. A381019, A381115, A381116.
%K A381117 nonn
%O A381117 1,1
%A A381117 _N. J. A. Sloane_, Feb 14 2025