Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Wilson's theorem
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example== For each of the values of ''n'' from 2 to 30, the following table shows the number (''n'' β 1)! and the remainder when (''n'' β 1)! is divided by ''n''. (In the notation of [[modular arithmetic]], the remainder when ''m'' is divided by ''n'' is written ''m'' mod ''n''.) The background color is blue for <span style="background-color:#94DCF2">prime</span> values of ''n'', gold for <span style="background-color:#E6C647">composite</span> values. {| class="wikitable" style="text-align:right" |+ Table of factorial and its remainder modulo ''n'' ! <math>n</math> !! <math>(n-1)!</math> <br/> {{OEIS|id=A000142}} !! <math>(n-1)!\ \bmod\ n</math> <br/> {{OEIS|id=A061006}} |- style="background-color:#94DCF2" | 2 || 1 || 1 |- style="background-color:#94DCF2" | 3 || 2 || 2 |- style="background-color:#E6C647" | 4 || 6 || 2 |- style="background-color:#94DCF2" | 5 || 24 || 4 |- style="background-color:#E6C647" | 6 || 120 || 0 |- style="background-color:#94DCF2" | 7 || 720 || 6 |- style="background-color:#E6C647" | 8 || 5040 || 0 |- style="background-color:#E6C647" | 9 || 40320 || 0 |- style="background-color:#E6C647" | 10 || 362880 || 0 |- style="background-color:#94DCF2" | 11 || 3628800 || 10 |- style="background-color:#E6C647" | 12 || 39916800 || 0 |- style="background-color:#94DCF2" | 13 || 479001600 || 12 |- style="background-color:#E6C647" | 14 || 6227020800 || 0 |- style="background-color:#E6C647" | 15 || 87178291200 || 0 |- style="background-color:#E6C647" | 16 || 1307674368000 || 0 |- style="background-color:#94DCF2" | 17 || 20922789888000 || 16 |- style="background-color:#E6C647" | 18 || 355687428096000 || 0 |- style="background-color:#94DCF2" | 19 || 6402373705728000 || 18 |- style="background-color:#E6C647" | 20 || 121645100408832000 || 0 |- style="background-color:#E6C647" | 21 || 2432902008176640000 || 0 |- style="background-color:#E6C647" | 22 || 51090942171709440000 || 0 |- style="background-color:#94DCF2" | 23 || 1124000727777607680000 || 22 |- style="background-color:#E6C647" | 24 || 25852016738884976640000 || 0 |- style="background-color:#E6C647" | 25 || 620448401733239439360000 || 0 |- style="background-color:#E6C647" | 26 || 15511210043330985984000000 || 0 |- style="background-color:#E6C647" | 27 || 403291461126605635584000000 || 0 |- style="background-color:#E6C647" | 28 || 10888869450418352160768000000 || 0 |- style="background-color:#94DCF2" | 29 || 304888344611713860501504000000 || 28 |- style="background-color:#E6C647" | 30 || 8841761993739701954543616000000 || 0 |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)