A100804 Smallest prime P such that n*P# -1 and n*P# +1 are twin primes, where P#=primorial P, or 0 if no such prime exists.
3, 2, 2, 11, 3, 2, 3, 5, 2, 3, 7, 3, 7, 5, 2, 7, 3, 3, 5, 5, 2, 5, 3, 11, 3
Offset: 1
Examples
For n=4: 4*2=8 8-1=7 prime but 8+1=9=3*3. 4*2*3=24 24-1=23 prime but 24+1=25=5*5. 4*2*3*5=120 120-1=119=7*17. 4*2*3*5*7=840 840-1=839 prime but 840+1=841=29*29. 4*2*3*5*7*11=9240 9240-1=9239 prime 9240+1=9241 prime so for n=4 P=11.
Crossrefs
Cf. A060256.
Programs
-
Mathematica
Primorial[n_] := Product[Prime[i], {i, n}]; f[n_] := Block[{k = 1}, While[p = n*Primorial[k]; !PrimeQ[p - 1]\ || ! PrimeQ[p + 1], k++ ]; Prime[k]]; Table[ f[n], {n, 25}] (* Robert G. Wilson v, Jan 12 2005 *)
Comments