标签:span 个数 therefore splay bec begin 练习题 lin 一个
若 \(gcd(a,m)=1\),则
\[a^{\phi(m)} \equiv 1 \pmod m\]
\(\phi(m),m>1\)表示\(\le m\)的数中与\(m\)互质的正整数的个数
设与\(m\)互质的数为\(b_1,b_2,...,b_{\phi(m)}\)
\(\because gcd(a,m)=1\)
\(\therefore ab_1,ab_2,...,ab_{\phi(m)}\)都与\(m\)互质,且均不相同
\(\therefore \{ b\}\)中,每个数都与\(\{ab\}\)中的一个数同余,且一一对应。
\(\therefore a^{\phi(m)}\prod_{i=1}^{\phi(m)}b_i \equiv \prod_{i=1}^{\phi(m)}ab_i\equiv \prod_{i=1}^{\phi(m)} b_i \pmod m\)
\(\therefore m|a^{\phi(m)}\prod_{i=1}^{\phi(m)}b_i-\prod_{i=1}^{\phi(m)}b_i\)
即\(m|(a^{\phi(m)}-1 \prod_{i=1}^{\phi(m)}b_i\)
又\(\because gcd(m,\prod_{i=1}^{\phi(m)}b_i)=1\)
\(\therefore m|a^{\phi(m)}-1\)
即有\(a^{\phi(m)}\equiv 1\pmod m\)
当\(p\)为质数,则
\[a^{p-1}\equiv 1 \pmod m\]
\(\because \text{此时},\phi(p)=p-1\)
可见,费马小定理是欧拉定理的一种特殊情况
即\(gcd(a,m) \ne 1\)时
先看\(gcd(a,m)=1\)
\[a^c \equiv a^{c \bmod \phi(m)} \pmod m\]
...
当\(gcd(a,m) \ne 1,c<\phi(m)\)时
\[a^c \equiv a^{c}\bmod m\]
无需证明
当\(gcd(a,m) \ne 1,c \ge \phi(m)\)时,
\[a^c \equiv a^{c \bmod \phi(m)+\phi(m)}\pmod m\]
设\(p\)为\(a\)的质因子,令\(m=s \times p^r,gcd(s,p)=1\)
\(p^{\phi(s)} \equiv 1 \pmod m\)
\(\because \text{s不含因子p}\)
\(\therefore \phi(s)|\phi(m)\)
\(\therefore p^{\phi(m)} \equiv 1 \pmod s\)
\(\to p^{k \phi(m)}\equiv 1 \pmod s\)
$\to p^{k \phi(m)+r}\equiv p^r \pmod {s \times p^r} $
$\to p^{k \phi(m)+r+c}\equiv p^{r+c} \pmod m $
\(\because k,c \in \mathbb{N}^+\)
\(\therefore \text{上述可表述为:若}c \ge r,\text{则} p^c \equiv p^{k \phi(m)+c} \pmod m\)
设\(a\)中含有因子\(p^k,c \ge \phi(m) \ge r\)
\[(p^k)^c \equiv q^{kc} \equiv p^{k \phi(m)+c} \equiv (p^k)^{\phi(m)+c} \equiv (p^k)^{t \phi(m)+c} \pmod m,t \in \mathbb{N^+}\]
\[\to (p^k)^c \equiv (p^k)^{c \bmod \phi(m)+\phi(m)},\text{保证指数}\ge \phi(m)\]
\(a\)的每个因子满足上式
根据同余的性质 则\(a^c \equiv a^{c \bmod \phi(m)+\phi(m) \pmod m}\)
于是
\[a^b =\begin{cases} a^b,b<\phi(p)\\a^{b \bmod \phi(p) + \phi(p)},b \ge \phi(p) \end{cases}\]
练习题就是上一篇的两道题
略
标签:span 个数 therefore splay bec begin 练习题 lin 一个
原文地址:https://www.cnblogs.com/cbyyc/p/11552498.html