maths.free › Number Theory › Fermat's little theorem and Euler's theorem
Fermat's little theorem and Euler's theorem
aᵖ⁻¹ ≡ 1 (mod p), the totient, and fast modular arithmetic.
For prime p and a not divisible by p, aᵖ⁻¹ ≡ 1 (mod p); Euler generalises to a^φ(n) ≡ 1 (mod n). These collapse huge exponents: 2¹⁰⁰ mod 13 reduces via 2¹² ≡ 1. Picture it: the powers of 2 mod 13 cycling around a 12-hour clock. Think it: this is Lagrange's theorem in the group (ℤ/n)*.
Օրինակ · 2^100 mod 13
Քայլ առ քայլ
- 2^{100} \bmod 13
Never compute the huge power. Reduce after every multiplication (repeated squaring).
- 2 \equiv 2 \pmod{13}
Reduce the base first.
- 100 = 1100100_2
Write the exponent in binary: 7 squarings at most.
- 2^2 \equiv 4 \pmod{13}
Square the running power.
- 4^2 \equiv 3 \pmod{13}
Square the running power.
- r \leftarrow r \cdot 3 \equiv 3 \pmod{13}
This bit is 1: multiply the result by the current power.
- 3^2 \equiv 9 \pmod{13}
Square the running power.
- 9^2 \equiv 3 \pmod{13}
Square the running power.
- 3^2 \equiv 9 \pmod{13}
Square the running power.
- r \leftarrow r \cdot 9 \equiv 1 \pmod{13}
This bit is 1: multiply the result by the current power.
- 9^2 \equiv 3 \pmod{13}
Square the running power.
- r \leftarrow r \cdot 3 \equiv 3 \pmod{13}
This bit is 1: multiply the result by the current power.
- 2^{100} \equiv 3 \pmod{13}
Done.
Առաջարկել պատասխանը
Now you Ընտրեք խնդիր, կամ տեքստ գրեք կամ նկարեք ձեր սեփականը։ Յուրաքանչյուր քայլ, նկար, պատասխանը թաքնված է մինչև դուք հարցնեք։
Ազատ հաշիվը յուրաքանչյուր դասավանդման համար գրառումներ է ավելացնում, Ձեր ավարտելիք դասերի և լուծված խնդիրների ցուցակ է պահում մեկ տեղում, և ուսուցիչ, ում կարող եք հարցնել այս էջի մասին։ Մաթեմատիկան բաց է բոլորի համար, անկախ նրանից մուտքագրվել եք արդյոք կամ ոչ։
Գրանցվել ԳրանցումՕգտագործված սիմվոլներ
Տեղադրեք ցանկացած նշան՝ ամբողջական սահմանման, նկարի և դրա մեջ ամեն մի տառի իմաստը տեսնելու համար։
Ինչպես: Fermat's little theorem and Euler's theorem
- Reduce the base mod n.
- Reduce the exponent mod p − 1 (prime) or mod φ(n) (general): Fermat/Euler.
- Finish with repeated squaring on what remains.
Հարցեր, որոնք մարդիկ տալիս են :
Why are primes so important?
Every integer factors into primes in exactly one way, so primes are the atoms of multiplication. Cryptography relies on that factoring being easy to state and hard to do.
How do I tell whether a big number is prime?
Trial division up to the square root works for small numbers. For large ones, probabilistic tests (Miller-Rabin) give an answer that is wrong with negligible probability, and deterministic tests (AKS) exist but are slower.
Ցուցադրել Number Theory
Prime factorisationPrime numbersGCD and LCMModular arithmeticDivisorsSequencesNumber basesDiophantine equationsRSA: cryptography from number theory