Number Theory

Remainder Theorem

Fermat's Theorem

According to Fermat’s Little Theorem, if \(p\) is a prime number and \(a\) is any integer, then \(({a^p} - a)\) is divisible by \(p\). This is written as \[\bbox[5px, border: 2px solid #0071dc]{a^p \equiv a (\bmod p)}\] This can also be written as \[\bbox[5px, border: 2px solid #0071dc]{a^p - a \equiv 0\,(\bmod \;p)}\]

For example \({2^7} - 2\) is a multiple of \(7\), \({3^{11}} - 3\) is a multiple of \(11\) etc. 

When \(a\) and \(p\) are co-prime, then \({a^{p - 1}} - 1\) is a multiple of \(p\).

This can be summarized as:       

  1. If \(p\) is a prime number and a is any whole number, then the number \(a^p - a\) is always multiple of \(p\). For example \(4^{41}-4\) is multiple of \(41\) and \(4^{71}-4\) is multiple of \(71\) etc.
  2. If \(p\) is a prime number and a is any whole number, then the number \({a^{p-1}}-1\) is always multiple of \(p\) where \(p\) and a are co–prime to each other.

Example 01: Find the remainder when \({2^{101}}\) is divided by 101.

Solution: We know that \({2^{101}}-{\rm{ }}2\) is always multiple of 101

\(\frac{{\mathop {({2^{101}} - 2}\limits^{} )\,\, + \,\,2}}{{101}}\) = 2

Example 02: Find the remainder when \({2^{71}}\) is divided by 142.

We know that \(({2^{71}} - 2)\) is a multiple of 71 and it is an even number also, hence it is a multiple of 2 as well, so \(({2^{71}} - 2)\)is a multiple of 142.

Now \({2^{71}} = \underbrace {({2^{71}} - 2)}_{{\rm{multiple}}\;{\rm{of}}\;{\rm{142}}} + 2\), so the remainder is 2.