login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A064998 a(n) is the smallest prime p such that p*n! +- 1 are twin primes. 1
2, 2, 3, 2, 17, 7, 7, 3, 61, 29, 167, 401, 167, 19, 311, 461, 97, 919, 47, 71, 1483, 107, 13, 1571, 821, 1361, 769, 239, 163, 4229, 593, 373, 1571, 173, 6229, 3331, 1879, 2837, 2633, 12329, 2311, 269, 4159, 1217, 9719, 509, 3049, 8429, 307, 6121, 7919 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,1
LINKS
EXAMPLE
a(6) = 17 because 17*6! = 12240, 12240 + 1 and 12240 - 1 are twin primes, and there is no prime less than 17 for which this pairing will work.
MATHEMATICA
Do[k = 1; While[ !PrimeQ[ Prime[k]*n! - 1] || !PrimeQ[ Prime[k]*n! + 1], k++ ]; Print[ Prime[k]], {n, 2, 75} ]
PROG
(PARI) { allocatemem(932245000); for (n=2, 200, f=n!; p=2; while (!isprime(p*f + 1) || !isprime(p*f - 1), p=nextprime(p + 1)); write("b064998.txt", n, " ", p) ) } \\ Harry J. Smith, Oct 03 2009
CROSSREFS
Sequence in context: A016009 A110088 A322005 * A329352 A300832 A329350
KEYWORD
nonn
AUTHOR
Robert G. Wilson v, Oct 31 2001
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 8 09:01 EDT 2024. Contains 374153 sequences. (Running on oeis4.)