OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..300
MAPLE
f:= proc(n) local p, t;
t:= n!;
p:= floor(sqrt(t));
do
p:= nextprime(p);
if isprime(p^2-t) then return p fi
od
end proc:
map(f, [$1..28]); # Robert Israel, Feb 10 2019
MATHEMATICA
f[n_] := Block[{p = NextPrime[ Sqrt[ n!]]}, While[ !PrimeQ[p^2 - n!], p = NextPrime@ p]; p]; Array[f, 27] (* Robert G. Wilson v, Jan 08 2015 *)
PROG
(PARI) a(n)=my(N=n!, x=sqrtint(N)+1); while(!isprime(x^2-N), x=nextprime(x+1)); x \\ Charles R Greathouse IV, Dec 09 2014
KEYWORD
nonn
AUTHOR
Artur Jasinski, Sep 05 2008
EXTENSIONS
Corrected by Charles R Greathouse IV, Dec 09 2014
STATUS
approved