OFFSET
2,1
COMMENTS
Does every prime appear in this sequence? - Gabriel Cunningham (gcasey(AT)mit.edu), Mar 27 2004
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 2..1000
EXAMPLE
a(2)=2 because 2*(prime(2)-1) + prime(2) = 7, which is prime.
a(7)=5 because 2*(prime(7)-1) + prime(7) = 49 and 3*(prime(7)-1) + prime(7) = 65, both of which are composite, but 5*(prime(7)-1) + prime(7) = 97, which is prime.
MATHEMATICA
spk[n_]:=Module[{k=2}, While[!PrimeQ[k(n-1)+n], k=NextPrime[k]]; k]; spk/@Prime[Range[2, 110]] (* Harvey P. Dale, Nov 06 2014 *)
PROG
(PARI) a(n) = p = prime(n); forprime(k=2, , if (isprime(k*(p-1) + p), return(k); )); \\ Michel Marcus, Nov 18 2014
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Dec 28 2003
EXTENSIONS
More terms from Gabriel Cunningham (gcasey(AT)mit.edu), Mar 27 2004
Corrected and offset corrected by Harvey P. Dale, Nov 06 2014
STATUS
approved