OFFSET
1,4
COMMENTS
Iff a(n) = 1, prime(n) is a Sophie Germain prime, i.e., in A005384. - A.H.M. Smeets, Feb 01 2018
LINKS
Zak Seidov, Table of n, a(n) for n = 1..10000
EXAMPLE
a(8)=5 because 2*prime(8)=38 and 5*38 + 1 is prime.
MATHEMATICA
Table[k := 1; While[ ! PrimeQ[2*k*Prime[n] + 1], k++ ]; k, {n, 1, 120}] (* Stefan Steinerberger, May 01 2006 *)
PROG
(PARI) a(n) = {my(p=prime(n), k=1); while (!isprime(2*k*p+1), k++); k; } \\ Michel Marcus, Feb 12 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Don Reble, Apr 25 2006
STATUS
approved