A073703 Smallest prime p such that also p+prime(n)*2 is a prime.
3, 5, 3, 3, 7, 3, 3, 3, 7, 3, 5, 5, 7, 3, 3, 3, 13, 5, 3, 7, 3, 5, 7, 3, 3, 31, 5, 13, 5, 3, 3, 7, 3, 3, 13, 5, 3, 5, 3, 3, 31, 5, 7, 3, 3, 3, 11, 3, 3, 3, 13, 13, 5, 7, 7, 31, 3, 5, 3, 7, 3, 7, 3, 19, 5, 7, 11, 3, 7, 3, 3, 43, 5, 5, 3, 3, 19, 3, 7, 3, 19, 11, 19, 11, 3, 43, 13, 5, 7, 3, 3, 13, 3
Offset: 1
Keywords
Examples
n=5: prime(5)=11; 2+11*2=24, 3+11*2=25 and 5+11*2=27 are not prime, but 7+11*2=29 is prime, therefore a(5)=7.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a073703 n = head [p | p <- a000040_list, a010051 (p + 2 * a000040 n) == 1] -- Reinhard Zumkeller, Oct 29 2013
-
Mathematica
f[n_] := Block[{k = Prime[n], p = Prime[n]}, While[ !PrimeQ[k - p] || !PrimeQ[k + p], k++ ]; k - p]; Table[ f[n], {n, 95}] (* Robert G. Wilson v, Aug 28 2004 *)
-
PARI
forprime(q=2,500,forprime(p=2,default(primelimit),if(isprime(2*q+p),print1(p", ");next(2)));error("Not enough precomputed primes")) \\ Charles R Greathouse IV, Aug 21 2011
Extensions
Merged with Pierre CAMI's submission of Aug 2004 - R. J. Mathar, Jul 29 2008
Comments