阶
设 (m > 1 , a perp m),使得 (a^n equiv 1 pmod{m}) 成立的最小的 (n) 称为 (a) 模 (m) 的阶 (delta_m(a))。
由欧拉定理 (a^{varphi(m)} equiv 1 pmod{m}) 得,(delta_m(a) mid varphi(m))。
原根
若 (delta_m(g) = varphi(m)),则 (g) 为模 (m) 的一个原根。
设 (g) 为模 (m) 的一个原根当且仅当 (left {g,g^2,dots,g^{varphi(m)} ight }) 构成模 (m) 的一个简化剩余系。
模 (m) 存在原根当且仅当 (m = 2,4,p^k,2p^k),(p) 为奇素数。
求一个原根:(g perp m),对于 (varphi(m)) 的所有奇素数,都有 (g^{frac{varphi(m)}{p_i}} ot equiv 1 pmod{m}),则 (g) 为模 (m) 的一个原根。
求所有原根:设 (g) 为模 (m) 的一个原根,则模 (m) 的所有原根为 (left {g^k mid 1 leqslant k leqslant varphi(m),k perp varphi(m) ight }),得模 (m) 存在 (varphi(varphi(m))) 个原根。