Day 1:数论——[整除性及组合数学篇]
注:
1.我们用 Z\mathbb{Z}Z 表示整数,∀\forall∀ 表示任意,∈\in∈ 表示属于,∃\exists∃ 表示存在。
2.似乎 ∣\mid∣ 的运算优先级特别低,所以注意打括号。
一、整除
1.定义
若有 Z\mathbb{Z}Z a,ba,ba,b ,a≠0a \neq 0a=0 ,如果 ∃\exists∃ 一个 Z\mathbb{Z}Z qqq ,使得 a⋅q=ba \cdot q = ba⋅q=b ,则 bbb 能被 aaa 整除( bbb 为 aaa 的倍数),记作 a∣ba \mid ba∣b,否则记为 a∤ba \nmid ba∤b 。
2.性质
①①① 传递性:如果 a∣ba \mid ba∣b 且 b∣cb \mid cb∣c ,则 a∣ca \mid ca∣c 。
证明:∵\because∵ a∣ba \mid ba∣b ∴\therefore∴ 令 a⋅x=ba \cdot x = ba⋅x=b (x∈Zx \in \mathbb{Z}x∈Z 且 x≠0x \neq 0x=0 )
又∵\because∵ b∣cb \mid cb∣c ∴\therefore∴ 令 b⋅y=cb \cdot y = cb⋅y=c (y∈Zy \in \mathbb{Z}y∈Z 且 y≠0y \neq 0y=0 )
∴\therefore∴ a⋅x⋅y=ca \cdot x \cdot y = ca⋅x⋅y=c
又∵\because∵ x,y∈Zx, y \in \mathbb{Z}x,y∈Z
∴\therefore∴ a∣ca \mid ca∣c
②②② 如果 a∣ba \mid ba∣b 且 b∣cb \mid cb∣c ,若有 ∀\forall∀ 的 Z\mathbb{Z}Z x,yx, yx,y ,有 a∣(b⋅x+c⋅y)a \mid (b \cdot x + c \cdot y)a∣(b⋅x+c⋅y)。
证明:∵\because∵ a∣ba \mid ba∣b ∴\therefore∴ 令 a⋅s=ba \cdot s = ba⋅s=b (s∈Zs \in \mathbb{Z}s∈Z 且 s≠0s \neq 0s=0 )
又∵\because∵ b∣cb \mid cb∣c ∴\therefore∴ 令 b⋅t=cb \cdot t = cb⋅t=c (t∈Zt \in \mathbb{Z}t∈Z 且 t≠0t \neq 0t=0 )
有 b⋅x+c⋅y=a⋅s⋅x+a⋅t⋅yb \cdot x + c \cdot y = a \cdot s \cdot x + a \cdot t \cdot yb⋅x+c⋅y=a⋅s⋅x+a⋅t⋅y
∴\therefore∴ a∣[a⋅(s⋅x+t⋅y)]a \mid [a \cdot (s \cdot x + t \cdot y)]a∣[a⋅(s⋅x+t⋅y)] ∴\therefore∴ a∣(b⋅x+c⋅y)a \mid (b \cdot x + c \cdot y)a∣(b⋅x+c⋅y)
③③③ 若 m≠0m \neq 0m=0,则 a∣ba \mid ba∣b 等价于 (m⋅a)∣(m⋅b)(m \cdot a) \mid (m \cdot b)(m⋅a)∣(m⋅b)
证明:∵\because∵ a∣ba \mid ba∣b ∴\therefore∴ 令a⋅x=ba \cdot x = ba⋅x=b (x∈Z,x≠0x \in \mathbb{Z}, x \neq 0x∈Z,x=0)
∴\therefore∴ a⋅x⋅m=b⋅ma \cdot x \cdot m = b \cdot ma⋅x⋅m=b⋅m (m∈Z,m≠0m \in \mathbb{Z}, m \neq 0m∈Z,m=0)
∴\therefore∴ x⋅a⋅m=b⋅mx \cdot a \cdot m = b \cdot mx⋅a⋅m=b⋅m (a⋅ma \cdot ma⋅m的 xxx 倍为 b⋅mb \cdot mb⋅m)
∴\therefore∴ (a⋅m)∣(b⋅m)(a \cdot m) \mid (b \cdot m)(a⋅m)∣(b⋅m)
④④④ 设 Z\mathbb{Z}Z x,yx, yx,y 满足下式:a⋅x+b⋅y=1a \cdot x + b \cdot y = 1a⋅x+b⋅y=1,且 a∣na \mid na∣n 、 b∣nb \mid nb∣n,那么 a⋅b∣na \cdot b \mid na⋅b∣n。
证明:∵\because∵ a∣na \mid na∣n 、 b∣nb \mid nb∣n
n=s⋅a=t⋅bn = s \cdot a = t \cdot bn=s⋅a=t⋅b (s,t∈Z且a、b、s、t≠0s, t \in \mathbb{Z} 且 a 、b、s、t \neq 0s,t∈Z且a、b、s、t=0)
又∵\because∵ a⋅x+b⋅y=1a \cdot x + b \cdot y = 1a⋅x+b⋅y=1
∴\therefore∴ xb+ya=1a⋅b\dfrac{x}{b} + \dfrac{y}{a} = \dfrac{1}{a \cdot b}bx+ay=a⋅b1
∴\therefore∴ na⋅b=n⋅(xb+ya)=n⋅xb+n⋅ya\dfrac{n}{a \cdot b} = n \cdot (\dfrac{x}{b} + \dfrac{y}{a}) = \dfrac{n \cdot x}{b} + \dfrac{n \cdot y}{a}a⋅bn=n⋅(bx+ay)=bn⋅x+an⋅y
又∵\because∵ x、y、s、t≠0x 、y、s、t \neq 0x、y、s、t=0
∴\therefore∴ na⋅b∈Z\dfrac{n}{a \cdot b} \in \mathbb{Z}a⋅bn∈Z ∴\therefore∴ a⋅b∣na \cdot b \mid na⋅b∣n
⑤⑤⑤ 若 b=q⋅d+c(q∈Z)b = q \cdot d + c (q \in \mathbb{Z})b=q⋅d+c(q∈Z) ,那么 d∣bd \mid bd∣b 的充要条件(充分必要条件)是 d∣cd \mid cd∣c。
相当于证明:已知
第一组证明:∵\because∵ d∣cd \mid cd∣c
∴\therefore∴ d⋅c≡c(x∈Z,x≠0)d \cdot c \equiv c(x \in \mathbb{Z},x \neq 0)d⋅c≡c(x∈Z,x=0)
∴\therefore∴ b=q⋅d+x⋅d=(q+x)⋅db = q \cdot d + x \cdot d = (q + x) \cdot db=q⋅d+x⋅d=(q+x)⋅d
∴\therefore∴ d∣bd \mid bd∣b
第二组证明:∵\because∵ d∣bd \mid bd∣b
∴\therefore∴ d⋅y=b(y∈Z,y≠0)d \cdot y = b(y \in \mathbb{Z},y \neq 0)d⋅y=b(y∈Z,y=0)
∴\therefore∴ d⋅y=q⋅d+cd \cdot y = q \cdot d + cd⋅y=q⋅d+c, c=d⋅(y−d)c = d \cdot (y - d)c=d⋅(y−d)
∵\because∵ (y−d)∈Z(y - d) \in \mathbb{Z}(y−d)∈Z
∴\therefore∴ d∣cd \mid cd∣c
二、模运算
1.定义
对于 Z\mathbb{Z}Z a,ba, ba,b ,其中 b≠0b \neq 0b=0,求 aaa 除以 bbb 的余数,称为 aaa 模 bbb ,记作 aaa modmodmod bbb 或 a%ba \% ba%b (似乎数学不能用 %\%% )
2.分配律
①①① (a±b)%c=(a%c±b%c)%c(a \pm b) \% c = (a \% c \pm b \% c) \% c(a±b)%c=(a%c±b%c)%c
证明:令 r1=a%c,r2=b%cr_1 = a \% c, r_2 = b \% cr1=a%c,r2=b%c
∴\therefore∴ a=q1⋅c+r1,b=q2⋅c+r2a = q_1 \cdot c + r_1, b = q_2 \cdot c + r_2a=q1⋅c+r1,b=q2⋅c+r2
∴\therefore∴ (q1⋅c±q2⋅c+r1±r2)%c=(r1±r2)%c=(a%c+b%c)%c(q_1 \cdot c \pm q_2 \cdot c + r_1 \pm r_2) \% c = (r_1 \pm r_2) \% c = (a \% c + b \% c) \% c(q1⋅c±q2⋅c+r1±r2)%c=(r1±r2)%c=(a%c+b%c)%c
②②② (a⋅b)%c=(a%c⋅b%c)%c(a \cdot b) \% c = (a \% c \cdot b \% c) \% c(a⋅b)%c=(a%c⋅b%c)%c
证明:令a%c=ma,b%c=mb,ac=sa,bc=sb(ma,mb,sa,sb∈Z)a \% c = m_a, b \% c = m_b, \dfrac{a}{c} = s_a, \dfrac{b}{c} = s_b(m_a, m_b, s_a, s_b \in \mathbb{Z})a%c=ma,b%c=mb,ca=sa,cb=sb(ma,mb,sa