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

%I #14 Feb 19 2024 10:28:12

%S 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,

%T 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,

%U 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

%N Remainder when (n-1)! + 1 is divided by n.

%C 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.

%D Albert H. Beiler, Recreations in The Theory of Numbers, The Queen of Mathematics Entertains, Second Edition, Dover Publications, Inc., New York, 1966, Page 50.

%H Antti Karttunen, <a href="/A055976/b055976.txt">Table of n, a(n) for n = 1..10000</a>

%t Do[Print[Mod[(n-1)!+1, n]], {n, 1, 100}]

%o (PARI) A055976(n) = (((n-1)!+1)%n); \\ _Antti Karttunen_, Aug 27 2017

%Y Cf. A061007.

%K easy,nonn

%O 1,4

%A _Robert G. Wilson v_, Jul 23 2000

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 April 25 01:06 EDT 2024. Contains 371964 sequences. (Running on oeis4.)