login
Least k such that k*P(n)#-P(n+1) and k*P(n)#+P(n+1) are both primes with P(i)=i-th prime and P(i)#=i-th primorial.
0

%I #7 Mar 28 2015 22:33:08

%S 4,2,1,2,14,1,4,1,5,42,3,19,33,12,48,105,26,5,35,23,49,70,160,59,52,

%T 141,105,96,154,103,174,114,140,314,615,97,42,6,781,240,8,71,764,14,

%U 321,197,916,823,901,23,390,121,1549,646,117,622,826,671,1577,339,313,465,62

%N Least k such that k*P(n)#-P(n+1) and k*P(n)#+P(n+1) are both primes with P(i)=i-th prime and P(i)#=i-th primorial.

%e 2*3*5*7-11=199 prime 2*3*5*7+11=221=13*17 composite

%e 2*2*3*5*7-11=409 prime 2*2*3*5*7+11=431 prime

%e 2*P(4)#-P(5) and 2*P(4)+P(5) both primes, so k=2 for n=4.

%t Primorial[n_] := Product[ Prime[i], {i, n}]; f[n_] := Block[{k = 1, p = Primorial[n], q = Prime[n + 1]}, While[k*p - q < 2 || !PrimeQ[k*p - q] || !PrimeQ[k*p + q], k++ ]; k]; Table[ f[n], {n, 63}] (* _Robert G. Wilson v_, Aug 31 2004 *)

%K easy,nonn

%O 1,1

%A _Pierre CAMI_, Aug 27 2004

%E More terms from _Robert G. Wilson v_, Aug 31 2004