OFFSET
1,2
EXAMPLE
3!=6, 6+1!+1=8, 6+2!+1=9, 6+3!+1=13, which is prime, so a(3)=3.
MATHEMATICA
a[1]=1; a[n_] := For[k=2, True, k++, If[Mod[n!+1, k]==0, Return[0]]; If[ProvablePrimeQ[n!+k!+1], Return[k]]] (* First do <<NumberTheory`PrimeQ` *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon Perry, Oct 08 2002
EXTENSIONS
Edited by Dean Hickerson, Oct 10 2002
The fact that 73!+153!+1 is prime, so a(73)=153, was proved, using Primo, by Robert G. Wilson v, Oct 16 2002
STATUS
approved