A055976 Remainder when (n-1)! + 1 is divided by n.
0, 0, 0, 3, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1
Offset: 1
References
- Albert H. Beiler, Recreations in The Theory of Numbers, The Queen of Mathematics Entertains, Second Edition, Dover Publications, Inc., New York, 1966, Page 50.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A061007.
Programs
-
Mathematica
Do[Print[Mod[(n-1)!+1, n]], {n, 1, 100}]
-
PARI
A055976(n) = (((n-1)!+1)%n); \\ Antti Karttunen, Aug 27 2017
Comments