login
a(n) is the first prime p such that each of the first n primes divides at least one of the composites between p and the next prime.
2

%I #18 Feb 20 2021 00:50:24

%S 2,3,5,7,13,19,61,113,113,113,113,113,773,773,773,887,887,2477,2477,

%T 2477,2477,2477,30727,31397,31397,31397,31397,31397,31397,155921,

%U 155921,155921,221327,221327,265621,265621,544279,544279,1242643,1242643,1242643,1444309,1444309,1444309,1561919,1561919

%N a(n) is the first prime p such that each of the first n primes divides at least one of the composites between p and the next prime.

%H Robert Israel, <a href="/A341650/b341650.txt">Table of n, a(n) for n = 0..86</a>

%e a(6) = 61 because each of the first 6 primes 2,3,5,7,11,13 divides at least one of the composites 62 to 66: 2|62, 3|63, 5|65, 7|63, 11|66 and 13|65.

%p N:= 50: # for a(0) to a(N)

%p P:= [seq(ithprime(i),i=1..N)]:

%p V:= Array(0..N): V[0]:= 2: q:= 3: m:= 0:

%p while m < N do

%p p:= q; q:= nextprime(p);

%p E:= mul(i,i=p+1..q-1);

%p for r from 1 to N do if E mod P[r] <> 0 then break fi od;

%p r:= r-1;

%p if r > m then

%p for s from m+1 to r do V[s]:= p od;

%p m:= r;

%p fi;

%p od:

%p convert(V,list);

%K nonn

%O 0,1

%A _J. M. Bergot_ and _Robert Israel_, Feb 16 2021