login
Least k such that k*p(n)# + p(n+1) is prime, where p(i)# denotes i-th primorial and p(i) denotes i-th prime.
0

%I #8 Aug 14 2024 16:16:41

%S 1,1,1,2,6,1,1,1,2,8,3,3,8,1,2,1,1,5,12,10,1,2,18,4,3,4,14,26,2,7,38,

%T 3,15,13,8,23,42,6,45,12,5,11,26,2,3,2,16,9,7,21,39,21,76,2,18,16,42,

%U 37,6,23,10,8,51,28,33,8,94,22,4,2,11,53,1,53,10,3,10,97,19,25,4,4,15,38,70

%N Least k such that k*p(n)# + p(n+1) is prime, where p(i)# denotes i-th primorial and p(i) denotes i-th prime.

%C k*p(n)# + p(n+1) is the least prime > k*p(n)# + p(n+1)+1 and if k*p(n)# + p(n+1)+1 is not prime it is the least prime > k*p(n)# + p(n+1).

%e 6 is the least k for n = 5 because 6*p(5)# + p(6) = 6*2*3*5*7*11+13 = 13873.

%t A002110[n_] := Product[Prime[i], {i, n}]; a[n_]:=Module[{k=1},While[!PrimeQ[k*A002110[n]+Prime[n+1]],k++]; k]; Array[a,85] (* _Stefano Spezia_, Aug 14 2024 *)

%Y Cf. A000040, A002110.

%K base,nonn

%O 1,4

%A _Pierre CAMI_, Jan 21 2004