Prime Test
We know that if n is prime, then:
{a^(n-1)} mod n = 1 [Fermat primality test]
Can anyone explain its mathematical proof?
ICPC NA North Central and South Division