login
This site is supported by donations 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

Antti Karttunen, Table of n, a(n) for n = 1..10000

MAPLE

P:=proc(q) local n; for n from 0 to q do print((n!+1) mod (n+1));

od; end: P(100); # Paolo P. Lava, Jun 16 2014

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: A318513 A323878 A046094 * A293305 A316896 A230626

Adjacent sequences:  A055973 A055974 A055975 * A055977 A055978 A055979

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 20 22:22 EDT 2019. Contains 322310 sequences. (Running on oeis4.)