[go: up one dir, main page]

login
A089452
a(n) = smallest prime k such that k*(prime(n)-1) + prime(n) is prime.
3
2, 2, 2, 2, 2, 5, 3, 2, 3, 5, 2, 5, 2, 2, 2, 3, 2, 2, 2, 5, 3, 113, 3, 5, 3, 2, 29, 3, 2, 2, 3, 2, 5, 3, 3, 5, 2, 2, 5, 5, 2, 2, 2, 17, 11, 2, 7, 11, 19, 3, 3, 13, 2, 2, 2, 5, 2, 2, 11, 3, 2, 2, 5, 2, 11, 2, 2, 2, 5, 3, 3, 19, 2, 5, 5, 3, 5, 2, 19, 29, 5, 2
OFFSET
2,1
COMMENTS
Does every prime appear in this sequence? - Gabriel Cunningham (gcasey(AT)mit.edu), Mar 27 2004
LINKS
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
Sequence in context: A180214 A329438 A263342 * A162487 A215924 A115101
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