OFFSET
1,1
COMMENTS
EXAMPLE
a(1)=2 because 2^2-1! = 3 is prime;
a(2)=2 because 2^2-2! = 2 is prime;
a(3)=3 because 3^2-3! = 3 is prime;
a(4)=11 because 11^2-4! = 97 is prime.
MATHEMATICA
a = {}; Do[k = Round[Sqrt[n! ]] + 1; While[ ! PrimeQ[k^2 - n! ], k++ ]; AppendTo[a, k], {n, 1, 50}]; a
spi[n_]:=Module[{k=Ceiling[Sqrt[n!]], nf=n!}, While[!PrimeQ[k^2-nf], k++]; k]; Array[ spi, 30] (* Harvey P. Dale, Feb 17 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Artur Jasinski, Sep 05 2008
STATUS
approved