|
|
A192434
|
|
Smallest prime p such that there is a gap of exactly n! between p and the next prime.
|
|
0
|
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
a(7) <=
5321252506668526413269161812412779312234715413010708809313699883082142158368298199 (see the Nicely page). - Abhiram R Devesh, Aug 09 2014
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(4) = 1669 because the next prime after 1669 is 1693 and 1693 - 1669 = 24 = 4!
|
|
MAPLE
|
with(numtheory):for n from 0 to 10 do:id:=0:for k from 1 to 2000000 while(id=0) do:p1:=ithprime(k):p2:=ithprime(k+1):if p2-p1 = n! then id:=1: printf(`%d, `, p1): else fi:od:od:
|
|
MATHEMATICA
|
f[n_] := Block[{k = 1}, While[Prime[k + 1] != n + Prime[k], k++ ]; Prime[k]]; Do[ Print[ f[n!]], {n, 0, 10}]
|
|
PROG
|
(PARI) a(n)=my(p=2); n=n!; forprime(q=3, default(primelimit), if(q-p==n, return(p)); p=q) \\ Charles R Greathouse IV, Jun 30 2011
(Python)
import sympy
n=0
while n>=0:
....p=2
....while sympy.nextprime(p)-p!=(sympy.factorial(n)):
........p=sympy.nextprime(p)
....print(p)
....n=n+1
....p=sympy.nextprime(p)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,hard
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|