Home > College Algebra calculators > Fermat's Little Theorem example

7. Fermat's Little Theorem example ( Enter your problem )
  1. Example-1 : `3^302 mod 5`
  2. Example-2 : `3^87 mod 5`
  3. Example-3 : `5^284 mod 7`
  4. Example-4 : `5^119 mod 59`
  5. Example-5 : `3^100,000 mod 53`
  6. Example-5 : `a=3` and `p=5`
  7. Example-5 : `a=3` and `p=7`
  8. Example-5 : `a=7` and `p=11`
  9. Example-5 : `a=7` and `p=13`
Other related methods
  1. Chinese Remainder Theorem
  2. Extended Euclidean Algorithm
  3. Euclid's Algorithm
  4. Modular multiplicative inverse
  5. Modulo
  6. Fast modular exponentiation
  7. Fermat's Little Theorem

1. Example-1 : `3^302 mod 5`
(Previous example)
3. Example-3 : `5^284 mod 7`
(Next example)

2. Example-2 : `3^87 mod 5`





3^87 mod 5 using Fermat's Little Theorem

Solution:
`3^(87) ("mod "5)`

Fermat's Little Theorem
`a^(p-1)-=1 ("mod "p)` (where `p` is prime, `a` is not divisible by `p`)


Step-1: Identify conditions :
`p=5` is prime.

`a=3` is not divisible by `p=5`.

So, Apply the theorem
`3^(5-1)-=1 ("mod "5)`

`3^(4)-=1 ("mod "5)`

Step-2: Reduce the exponent `87`

`87-:4=21` with a remainder of `3`

i.e., `87=4xx21+3`

Step-3: Simplify
We have
`3^(4)-=1 ("mod "5)`

Taking power `21` on both sides

`(3^(4))^21-=1^21 ("mod "5)`

`3^((4xx21))-=1 ("mod "5)`

Multiply by `3^3` on both sides

`3^((4xx21))xx3^3-=1xx3^3 ("mod "5)`

`3^((4xx21)+3)-=3^3 ("mod "5)`

`3^(87)-=27 ("mod "5)`

`3^(87)-=2 ("mod "5)`

`:.` The remainder is `2` when you divide `3^(87)` by `5`




This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then Submit Here



1. Example-1 : `3^302 mod 5`
(Previous example)
3. Example-3 : `5^284 mod 7`
(Next example)





Share this solution or page with your friends.
 
 
Copyright © 2025. All rights reserved. Terms, Privacy
 
 

.