login
Smallest prime p such that none of p+1, p+2, ..., p+n are squarefree.
5

%I #34 Jan 22 2022 23:41:25

%S 2,3,7,47,241,2887,57119,217069,37923937,211014919,221167421,221167421

%N Smallest prime p such that none of p+1, p+2, ..., p+n are squarefree.

%C a(10) = 221167421.

%C From _Robert Israel_, Apr 23 2015: (Start)

%C a(n) >= A020754(n), with equality when A020754(n) is prime. This occurs for n = 2,3,4,5,8 and 11.

%C Each a(n) exists: given distinct primes q_j, j=1..n, such that q_j does not divide j, by Dirichlet's theorem there is some prime in the arithmetic progression

%C {x: x == -j (mod q_j^2) for j=1..n}.

%C (End)

%F a(n) << A002110(n)^10 by the CRT and Xylouris' improvement to Linnik's theorem. - _Charles R Greathouse IV_, Apr 29 2015

%e 47 is a(3) because none of 2^2*12 = 48, 7^2 = 49, 2*5^2 = 50 is squarefree.

%p p:= 2:

%p A[0]:= 2:

%p for n from 1 to 8 do

%p while ormap(numtheory:-issqrfree, [seq(p+i,i=1..n)]) do p:= nextprime(p) od:

%p A[n]:= p;

%p od:

%p seq(A[i],i=1..8); # _Robert Israel_, Apr 23 2015

%t lst={2};Do[If[Union[SquareFreeQ/@Range[Prime[n]+1,Prime[n]+Length[lst]]]=={False},AppendTo[lst,Prime[n]]],{n,10^5}];lst (* _Ivan N. Ianakiev_, May 02 2015 *)

%o (PARI) a(n)=forprime(p=2, , for(k=1, n, if(issquarefree(p+k), next(2))); return(p)) \\ _Charles R Greathouse IV_, Apr 29 2015

%Y Cf. A020754.

%K nonn,more

%O 0,1

%A _Juri-Stepan Gerasimov_, Apr 23 2015

%E a(8) from _Robert Israel_, Apr 23 2015

%E a(9)-a(11) from _Charles R Greathouse IV_, Apr 29 2015