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