login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A055976 Remainder when (n-1)! + 1 is divided by n. 6
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
COMMENTS
Related to Wilson's theorem. a(n) = 0 iff n = 1 or a prime; a(n) = 1 iff n > 4 is composite; a(n) = 3 iff n = 4.
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
MATHEMATICA
Do[Print[Mod[(n-1)!+1, n]], {n, 1, 100}]
PROG
(PARI) A055976(n) = (((n-1)!+1)%n); \\ Antti Karttunen, Aug 27 2017
CROSSREFS
Cf. A061007.
Sequence in context: A354058 A323878 A046094 * A293305 A316896 A230626
KEYWORD
easy,nonn
AUTHOR
Robert G. Wilson v, Jul 23 2000
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 06:15 EDT 2024. Contains 371265 sequences. (Running on oeis4.)