#A10 · Algebra & Number Theory · Lv.3View in 3D Mind-Map

Modular Arithmetic & Fermat's Little Theorem

Pierre de Fermat, Euler & Gauss · 1640 CE

ap−1≡1(modp)(gcd⁡(a,p)=1)a^{p-1} \equiv 1 \pmod{p} \quad (\gcd(a, p) = 1)
a≡b(modn)  ⟺  n∣(a−b)a \equiv b \pmod{n} \iff n \mid (a - b)

In clock arithmetic modulo a prime p, raising any coprime integer a to the (p-1)-th power yields a remainder of 1—the mathematical backbone of RSA public-key cryptography.

🧮 Live Formula Calculator & Plotter
Base a
Exponent e
Modulus p
36≡1(mod7),36≡1(mod7)3^{6} \equiv 1 \pmod{7}, \quad 3^{6} \equiv 1 \pmod{7}
3^6 mod 7
1
페르마 a^(p-1) mod p
1
모듈러 역원 a^(p-2)
5
^13.0^22.0^36.0^44.0^55.0^61.0

Prerequisite Path (5 STEP)

Full Path Analyzer

Click steps in order to follow the 3D neon path from basics to target.

Geometric & Intuitive Insight

12시간제 시계에서 15시는 3시와 합동(15 ≡ 3 mod 12)입니다. 소수 p로 나눈 나머지 세계에서는 {1, 2, …, p-1} 전체에 a를 곱해도 순서만 뒤섞일 뿐 집합 전체의 곱이 보존되어 a^(p-1) ≡ 1 (mod p)가 성립합니다.

Step-by-Step Derivation

  1. Step 1.1단계: 소수 p와 서로소인 a에 대해 {a, 2a, 3a, …, (p-1)a} 를 p로 나눈 나머지는 모두 다릅니다.
  2. Step 2.2단계: 따라서 이 나머지들의 집합은 {1, 2, 3, …, p-1} 과 순서만 다른 동일한 집합입니다.
  3. Step 3.3단계: 모든 원소를 곱하면 a^(p-1) · (p-1)! ≡ (p-1)! (mod p) 이고, (p-1)! 을 약분하면 a^(p-1) ≡ 1 (mod p)

AI & Coding Real-World Use

HTTPS/TLS RSA public-key encryption, blockchain digital signatures, and hash table indexing

#RSA Cryptography#Blockchain Security#Hash Table Modulo
const modPow = (a: bigint, e: bigint, m: bigint): bigint => /* binary exp */

Algebra & Number Theory — Related Formulas in This Cluster