OFFSET
0,1
COMMENTS
Prime generating formula based on Wilson's theorem.
REFERENCES
Wladyslaw Narkiewicz, The development of prime number theory: from Euclid to Hardy and Littlewood, Springer-Verlag, New York, 2000, pp. 46-47.
LINKS
M. Prunescu and L. Sauras-Altuzarra, An arithmetic term for the factorial function, Examples and Counterexamples, Vol. 5 (2024).
MAPLE
f:=n->(2*n! mod (n+1))+2; [seq(f(n), n=0..100)];
MATHEMATICA
a[n_] := 2 + Mod[2*n!, n + 1]
Table[a[n], {n, 0, 100}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger L. Bagula, May 13 2006
EXTENSIONS
Edited by N. J. A. Sloane, Jun 12 2007
STATUS
approved