Advertisement
RaFiN_

Fermat’s little theorem

Oct 13th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. Fermat’s little theorem states that if p is a prime number, then for any integer a, the number (a
  2. p−a)
  3. is an integer multiple of p. In the notation of modular arithmetic, this is expressed as
  4. a
  5. p ≡ a(mod p)
  6. For example, if a = 2 and p = 7, 2
  7. 7 = 128, and 128 − 2 = 7 × 18 is an integer multiple of 7. We can
  8. also write 128%7 = 2, here % is the modulo operator used in C/C++ or Java.
  9. If a is not divisible by p, Fermat’s little theorem is equivalent to the statement that a
  10. p−1 − 1 is an
  11. integer multiple of p, or in symbols
  12. a
  13. p−1 ≡ 1(mod p)
  14. For example, if a = 2 and p = 7 then 2
  15. 6 = 64 and 64 − 1 = 63 is a multiple of 7. We can also write
  16. 64%7 = 1.
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement