Number Theory
Remainder Theorem
Wilson's Theorem
If \(p\) is a prime number then \((p - 1)! + 1\) is always divisible by \(p\).
For example \(18! + 1\) is multiple of \(19, 22! + 1\) is multiple of 23 etc. For example if we have to find the remainder when \(28!\) Is divided by 29,
We can apply this theorem, we know that \(28!+1\) is multiple of 29, hence when \(28!\) is divided by 29, remainder is -1 or 28.
\(\frac{{28!}}{{29}} = \frac{{(28!\, + 1) - 1}}{{29}} = - 1\) or \(28\)
Example 27: Find the remainder when \(6.27!\) is divided by 31
Solution: \(6.27!\) can be written as \(1.2.3.27!\)
When \(1.2.3.(27!)\) is divided by 31, remainder is
\((-30).(-29).(-28)(27!)\) that is equal to \((-30!)\),
now the remainder is \(\frac{{ - (30!)}}{{31}} = 1\)