AKS Primality Testing
AKS Primality Testing Algorithm Short Description The AKS (Agrawal–Kayal–Saxena) algorithm is a deterministic polynomial-time algorithm used to test whether a given number is prime. Unlike probabilistic methods such as the Fermat or Miller–Rabin tests, AKS always produces a correct result without relying on randomness. Introduced in 2002 by Agrawal, Kayal, and Saxena, this algorithm resolved a long-standing open problem in computer science by proving that primality testing belongs to the complexity class P . 2. Mathematical Foundation 2.1 Fermat’s Little Theorem (Classical) If p p p is prime and a a a is not divisible by p p p : a p ≡ a ( m o d p ) a^{p} \equiv a \pmod{p} This is the basis of many probabilistic tests. ❗ Problem: Some composite numbers (Carmichael numbers) also satisfy this. 3. Key Insight Behind AKS Instead of working with numbers , AKS works with polynomials . AKS Theorem For an integer n > 1 n > 1 n > 1 , n is prime ⟺ ( ...