Fermat's Little Theorem is a key result in number theory that helps simplify powers in modular arithmetic. This cheat sheet covers the theorem, when it applies, and how it is used to find remainders and modular inverses. Students need it because large exponent problems become manageable when powers repeat in predictable cycles.
It is especially useful for contest math, cryptography basics, and advanced algebra topics.
The main idea is that if is prime and is not divisible by , then . This means exponents can often be reduced modulo when working mod . A related form says for any integer .
Applications include computing large remainders, checking divisibility patterns, and finding inverses using .
Key Facts
- If is prime and , then Fermat's Little Theorem states .
- For any integer and prime , the equivalent form is always true.
- When is prime and , exponents can be reduced using where .
- If is prime and , the modular inverse of modulo is .
- The condition is required for the form .
- If , then for any positive integer .
- To compute a large power like , first reduce modulo , then reduce modulo when is prime and .
- Fermat's Little Theorem does not prove that is prime just because holds for one value of .
Vocabulary
- Prime modulus
- A modulus that is a prime number, which is required for the standard form of Fermat's Little Theorem.
- Congruence
- A statement meaning that and have the same remainder when divided by .
- Relatively prime
- Two integers and are relatively prime when .
- Modular inverse
- The modular inverse of modulo is a number such that .
- Exponent reduction
- Exponent reduction is the process of replacing a large exponent with a smaller congruent exponent, often using .
- Remainder class
- A remainder class is the set of all integers that are congruent to the same value modulo .
Common Mistakes to Avoid
- Using when is wrong because the theorem requires for that form.
- Applying Fermat's Little Theorem with a composite modulus is wrong because is guaranteed only when is prime.
- Reducing the exponent modulo instead of modulo is wrong because the power cycle from Fermat's Little Theorem has length dividing .
- Changing to is wrong because for , so an exponent reduction that gives usually means .
- Assuming one successful Fermat test proves primality is wrong because some composite numbers can satisfy for certain bases .
Practice Questions
- 1 Find the remainder when is divided by .
- 2 Find the modular inverse of modulo using Fermat's Little Theorem.
- 3 Compute .
- 4 Explain why Fermat's Little Theorem can be used to reduce the exponent in , but not directly in .