login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A118136
a(n) = 2 + (2*n! mod n+1).
0
2, 2, 3, 2, 5, 2, 7, 2, 2, 2, 11, 2, 13, 2, 2, 2, 17, 2, 19, 2, 2, 2, 23, 2, 2, 2, 2, 2, 29, 2, 31, 2, 2, 2, 2, 2, 37, 2, 2, 2, 41, 2, 43, 2, 2, 2, 47, 2, 2, 2, 2, 2, 53, 2, 2, 2, 2, 2, 59, 2, 61, 2, 2, 2, 2, 2, 67, 2, 2, 2, 71, 2, 73, 2, 2, 2, 2, 2, 79, 2, 2, 2, 83, 2, 2, 2, 2, 2, 89, 2, 2, 2, 2, 2, 2, 2
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
Sequence in context: A298422 A304716 A237984 * A356552 A258567 A076396
KEYWORD
nonn
AUTHOR
Roger L. Bagula, May 13 2006
EXTENSIONS
Edited by N. J. A. Sloane, Jun 12 2007
STATUS
approved