login
Least prime p that for some integer k there exist at least n positive primes of the form q!-p for n consecutive integers q belonging to {k,k+1,k+2,..k+n-1}.
2

%I #9 Jun 12 2024 17:47:13

%S 3,7,11,17,191,50377,92761,2085737,30357947,1165922581,8547418259,

%T 35368198867

%N Least prime p that for some integer k there exist at least n positive primes of the form q!-p for n consecutive integers q belonging to {k,k+1,k+2,..k+n-1}.

%C n=1,{3}!-3.

%C n=2,{4,5}!-7.

%C n=3,{4,5,6}!-11.

%C n=4,{9,10,11,12}!-17.

%C n=5,{22,23,24,25,26}!-191.

%C n=6,{12,13,14,15,16,17}!-50377.

%C n=7,{11,12,13,14,15,16,17}!-92761.

%C n=8,{10,12,13,14,15,16,17}!-2085737.

%C n=9,{11,12,13,14,15,16,17,18,19}!-30357947.

%C n=10,{16,17,18,19,20,21,22,23,24,25}!-1165922581.

%C n=11,{14,15,16,17,18,19,20,21,22,23,24}!-8547418259.

%C n=12,{15,16,17,18,19,20,21,22,23,24,25,26}!-35368198867.

%H Mrexcel, <a href="https://math.stackexchange.com/questions/4911124">Primes with the form q!-p for prime p and n consecutive integers q∈{k,k+1,k+2,..k+n-1}</a>

%e a(4) = 17 because there exist 4 consecutive integers q {9,10,11,12} such that the numbers q!-17 are all positive primes.

%t t[n_] :=

%t Module[{m = 0, s = {}},

%t For[k = 1, k < 20, k++, If[k! > n && PrimeQ[k! - n], m++;

%t AppendTo[s, k];]]; {Length@s, n, s,

%t Minus[Subtract @@@ Partition[s, 2, 1]]}];

%t a[n_] :=

%t If[n == 1, 3, For[r = 1, r <= 10^5, r++, s = Prime@r; v = t[s];

%t If[v[[1]] > 0 && SequenceCount[v[[4]], PadLeft[{}, n - 1, 1]] > 0,

%t Return[v[[2]]];]]]

%t Table[a[n], {n, 7}]

%K nonn,more

%O 1,1

%A _Zhining Yang_, Jun 11 2024