|
|
A033932
|
|
Least positive m such that n! + m is prime.
|
|
23
|
|
|
1, 1, 1, 1, 5, 7, 7, 11, 23, 17, 11, 1, 29, 67, 19, 43, 23, 31, 37, 89, 29, 31, 31, 97, 131, 41, 59, 1, 67, 223, 107, 127, 79, 37, 97, 61, 131, 1, 43, 97, 53, 1, 97, 71, 47, 239, 101, 233, 53, 83, 61, 271, 53, 71, 223, 71, 149, 107, 283, 293, 271, 769, 131, 271
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
Conjecture: No term is a composite number. a(n) is a prime > 3*prime(k), where k is such that prime(k) < n <= prime(k+1). - Amarnath Murthy, Apr 07 2004
Terms after n = 2000 in the b-file correspond to Fermat and Lucas PRP. - Phillip Poplin, Oct 12 2019
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
a:= n-> (f-> nextprime(f)-f)(n!):
|
|
MATHEMATICA
|
a[n_] := (an = 1; While[ !PrimeQ[n! + an], an++]; an); Table[a[n], {n, 0, 63}] (* Jean-François Alcover, Dec 05 2012 *)
|
|
PROG
|
(PARI) for(n=0, 70, k=1; while(!isprime(n!+k), k++); print1(k, ", "))
(PARI) a(n) = nextprime(n!+1) - n!; \\ Michel Marcus, Dec 25 2020
(Python)
from sympy import factorial, nextprime
def a(n): fn = factorial(n); return nextprime(fn) - fn
|
|
CROSSREFS
|
|
|
KEYWORD
|
nice,nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|