math-eulers-theorem.html


* created: 2025-11-18T16:25
* modified: 2025-12-19T14:33

title

Eulers Theorem

description

Allow for the quick calculation for $a^b \mod p$.

Eulers Theorem

\forall a,b,n \in \mathbb{N} with \gcd(a,n) = 1 the following holds:

a^{b} \mod n = a^{b \mod \varphi(n)} \mod n

Eulers phi function \varphi(n)

Is used to calculate the magnitude of \mathbb{Z}_{n}^{*}. With n \in \mathbb{N}:

\varphi(n) = | \{ x \in \{1,\ldots,n-1\} \;|\; \gcd(x,n) = 1 \}| = |\mathbb{Z}_n^*|

With p, q \in \mathbb{P}, p \neq q, n = p \cdot q the following holds: \varphi(n)=(p-1)(q-1)