【余数与同余】

· · 个人记录

符号

$a \bot b$:$a$ 与 $b$ 互质。 $a \mid b$:$a$ 整除 $b$ ,即 $b$ 除以 $a$ 为整数 $(\frac{b}{a}\in\mathbb{Z})$。 ### 余数的性质 - $(a\pm b)\bmod n=(a\bmod n\pm b\bmod n)\bmod n

同余

若 a \bmod n=x 且 b \bmod n=x,即 a 与 b 除以 n 的余数相同,表示为 a \equiv b(\bmod\ n),可写成 \frac{a-b}{n}\in\mathbb{Z} 或 n|a-b。

同余的性质

同余的定理

证明:

设 {x_{\phi(n)}},x_i\bot n,x_i\in[1,n]

\because x_i \bmod n=x_i,x_j \bmod n=x_j,x_i\not= x_j,i\not= j \therefore x_i\not\equiv x_j(\bmod\ n)

有 {ax_{\phi(n)}} 为 a\cdot{x_{\phi(n)}}

\because n\nmid x_i-x_j \therefore n\nmid a(x_i-x_j) \therefore ax_i\not\equiv ax_j(\bmod\ n) \because a\bot n,x_i\bot n\therefore ax_i\bot n \therefore (\prod_{i=1}^{\phi(n)} x_i)\bot n \therefore \prod_{i=1}^{\phi(n)} x_i\equiv \prod_{i=1}^{\phi(n)} ax_i\equiv a^{\phi(n)}\prod_{i=1}^{\phi(n)} x_i(\bmod\ n) \therefore \prod_{i=1}^{\phi(n)} x_i\equiv a^{\phi(n)}\prod_{i=1}^{\phi(n)} x_i(\bmod\ n) 1\equiv a^{\phi(n)}(\bmod\ n) QED.

证明:

设 b=q\cdot \phi(n)+r,r\in[0,\phi(n))

\therefore r=b\bmod \phi(n) a^b\equiv a^{q\cdot \phi(n)+r}\equiv a^{q\cdot \phi(n)}\cdot a^r\equiv (a^{\phi(n)})^q\cdot a^r\equiv 1^q\cdot a^r\equiv a^r\equiv a^{b\bmod \phi(n)}(\bmod\ n)

证明:

由欧拉定理得:a^{p-1}\equiv 1(\bmod\ p)

\therefore a^p\equiv a(\bmod\ p) QED.