# Week 1 - Session 2 ## Fermat's Little Theorem $ a^{p-1}\equiv1modp$ Where p is a prime and a is not a prime Inverse of `a` mod `p` is $ a^{p-2}$ ![Image-1](S2_1.png) ## Euler's Totient Function - When `n` is a prime number, `p`, then `totient(n)=p-1` - When `p` and `q` are both primes, then `totient(n)=(p-1)(q-1)` $ \phi(n)=n-p-q+1$ $ =pq-p-q+1$ $ =(p-1)(q-1)$ ![Image-2](S2_2.png) ## Euler's Theorem - States for an integer `a` relatively prime to `n` $ a^{\phi(n)}$ is congruent to `1`modulo`n`