基础数论(9.1)[45%]

本文介绍了基础数论中的整除概念及其性质、模运算的定义与定律,包括整除的推论,以及同余的概念、定律和性质。此外,还探讨了组合数学中的经典模型,如小球与盒子问题。内容深入浅出,适合进阶C++学习者巩固数论基础知识。
摘要由CSDN通过智能技术生成

数学是一切理科学习的基石
− {\large\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad-} 鲁迅

0 x 00 0x00 0x00.引入

C + + C++ C++的学习中, 除了基础算法, 还包括一定的基础数论知识 似乎是高中的知识呢. 之后, 我们就可以快乐地迎接毒瘤出题人的考验毒打

0 x 01 0x01 0x01.整除

一.定义

a , b ∈ Z   ( a ≠ 0 ) a,b \in \mathbb{Z}\ (a \not= 0) a,bZ (a=0) 如果 ∃ \exists 一个 Z   q \mathbb{Z}\ q Z q, 使得 a   q = b a \, q = b aq=b, 则 b b b 能被 a a a 整除, 记作 a ∣ b a\mid b ab, 否则记作 a ∤ b a\nmid b \quad ab(看起来人畜无害的样子)

二.性质

(1) 如果 a ∣ b a \mid b ab b ∣ c b \mid c bc, 则 a ∣ c a \mid c ac


Q Q Q:就不能写易证吗?

A A A:你在数学题里写易证试试,看老师不给你扣完 !

− {\large\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad-} c q b z g m cqbzgm cqbzgm

证:

a   x = b ( x ∈ Z a \, x = b (x \in \mathbb{Z} ax=b(xZ x ≠ 0 ) x \not= 0) x=0)

         b   y = c ( y ∈ Z \;\;\;\;b \, y = c (y \in \mathbb{Z} by=c(yZ y ≠ 0 ) y \not= 0) y=0)

∴   a   x   y = c \therefore \ a \, x \, y = c  axy=c

∴   a ∣ c \therefore \ a \mid c  ac


(2) 如果 a ∣ b a \mid b ab a ∣ c    ⟺    ⁣ a \mid c \iff \! ac  ⁣ ∀ x , y ∈ Z \! \forall x,y \in \mathbb{Z} x,yZ a ∣ b   x + c   y a \mid b \, x + c\, y abx+cy


证:

a   p = b ( p ∈ Z a \, p = b (p \in \mathbb{Z} ap=b(pZ p ≠ 0 ) p \not= 0) p=0)

         a   q = c ( q ∈ Z \;\;\;\;a \, q = c (q \in \mathbb{Z} aq=c(qZ q ≠ 0 ) q \not= 0) q=0)

∵ b   x + c   y = a   p   x + a   q   y \because b \, x + c \, y = a \, p \, x + a \, q \,y bx+cy=apx+aqy

       = a   ( p   x + q   y ) \qquad \qquad \quad \;\;\; = a \, (p \, x + q \, y) =a(px+qy)

∴ a ∣ b   x + c   y \therefore a \mid b \, x + c \, y abx+cy


(3) 设 m ∈ Z m \in \mathbb{Z} mZ m ≠ 0 m \not= 0 m=0 a ∣ b    ⟺    m   a ∣ m   b a \mid b \iff m \, a \mid m \, b abmamb


证:

a   x = b ( x ∈ Z a \, x = b (x \in \mathbb{Z} ax=b(xZ x ≠ 0 ) x \not= 0) x=0)

∴ a   x   m = b   m    ⟺    x   a   m = b   m \therefore a \, x \, m = b \, m \iff x \, a \, m = b \, m axm=bmxam=bm

∴ a   m ∣ b   m \therefore a \, m \mid b \, m ambm


(4) 设 x , y ∈ Z x, y \in \mathbb{Z} x,yZ 满足下式: a   x + b   y = 1 a \, x + b \, y = 1 ax+by=1 a ∣ n , b ∣ n a \mid n , b \mid n an,bn 那么 a   b ∣ n a \, b \mid n abn


证:

n = a   p = b   q   ( p , q ∈ Z ) n = a \, p = b \, q \ (p, q \in \mathbb{Z}) n=ap=bq (p,qZ)

∴ a , b ≠ 0 \therefore a, b \not= 0 a,b=0

∴ a   x + b   y = 1 ⇒ x b + y a = 1 a   b \therefore a \, x + b \, y = 1 \Rightarrow \frac{x}{b} + \frac{y}{a} = \frac{1}{a \, b} ax+by=1bx+ay=ab1

∴ n a   b = n   ( x b + y a ) \therefore \frac{n}{a \, b} = n \, (\frac{x}{b} + \frac{y}{a}) abn=n(bx+ay)

          = n   x b + n   y a \quad \; \, \; \; \; =\frac{n \, x}{b} + \frac{n \, y}{a} =bnx+any

          = p   x + q   y \quad \; \; \; \; \, = p \,x + q \, y =px+qy

∴ n a   b ∈ Z \therefore \frac{n}{a \, b} \in \mathbb{Z} abnZ

∴ a   b ∣ n \therefore a \, b \mid n abn


(5) 若 b = q   d + c   ( q ∈ Z ) b = q \, d + c \ (q \in \mathbb{Z}) b=qd+c (qZ)那么 d ∣ b    ⟺    d ∣ c d \mid b \iff d \mid c dbdc [ ^[ [1 ] ^] ]


即证:

1. { d ∣ c b = q   a + c ⇒ d ∣ b 1.\begin{cases} d \mid c\\ b = q \, a + c&\end{cases} \Rightarrow d \mid b 1.{ dcb=qa+cdb

2. { d ∣ b b = q   a + c ⇒ d ∣ c 2.\begin{cases} d \mid b\\ b = q \, a + c&\end{cases} \Rightarrow d \mid c 2.{ dbb=qa+cdc

证:

d   x = c   ( x ∈ Z ) d \, x = c \ (x \in \mathbb{Z}) dx=c (xZ) ( 1 ) (1) (1)

∴ b = q   + x   d \therefore b = q \, + x \, d b=q+xd

     = d   ( q + x ) \quad \; \, \,= d \, ( q + x) =d(q+x)

∴ d ∣ b \therefore d \mid b db

d   y = c   ( y ∈ Z ) d \, y = c \ (y \in \mathbb{Z}) dy=c (yZ) ( 2 ) (2) (2)

∴ d   y = q   d + c \therefore d \, y = q \, d+ c dy=qd+c

∴ c = d   ( y − q ) \therefore c = d \, (y - q) c=d(yq)

∴ d ∣ c \therefore d \mid c dc

∴ d ∣ b ⇔ d ∣ c \therefore d \mid b \Leftrightarrow d \mid c dbdc

三.推论

请先阅读 0 x 02 0x02 0x02模运算.

(1)设 a ∈ Z a \in \mathbb{Z} aZ 2 ∣ ( a % 10 ) 2 \mid (a \% 10) 2(a%10), 则 2 ∣ a 2 \mid a 2a


证:

x = ( a % 10 ) x = (a\%10) x=(a%10);

A A A 为除末位外的部分, 则 a = 10  ⁣ ×  ⁣ A + x a = 10 \! \times \! A + x a=10×A+x

∴ a % 2 = ( ( 10  ⁣ ×  ⁣ A ) % 2 + x % 2 ) % 2 \therefore a \% 2 = ((10\!\times\!A) \% 2 + x \% 2) \% 2 a%2=((10×A)%2+x%2)%2

∵ 2 ∣ x \because 2 \mid x 2x

∴ 2 ∣ a \therefore 2 \mid a 2a


(2)设 a ∈ Z a \in \mathbb{Z} aZ 4 ∣ ( a % 100 ) 4 \mid (a \% 100) 4(a%100), 则 4 ∣ a 4 \mid a 4a


证:

x = ( a % 100 ) x = (a\%100) x=(a%100);

A A A 为除后两位外的部分, 则 a = 100  ⁣ ×  ⁣ A + x a = 100 \! \times \! A + x a=100×A+x

∴ a % 4 = ( ( 100  ⁣ ×  ⁣ A ) % 4 + x % 4 ) % 4 \therefore a \% 4 = ((100\!\times\!A) \% 4 + x \% 4) \% 4 a%4=((100×A)%4+x%4)%4

∵ 4 ∣ x \because 4 \mid x 4x

∴ 4 ∣ a \therefore 4 \mid a 4a


(3)设 a ∈ Z a \in \mathbb{Z} aZ 8 ∣ ( a % 1000 ) 8 \mid (a \% 1000) 8(a%1000), 则 8 ∣ a 8 \mid a 8a


证:

x = ( a % 1000 ) x = (a\%1000) x=(a%1000);

A A A 为除后三位外的部分, 则 a = 1000  ⁣ ×  ⁣ A + x a = 1000 \! \times \! A + x a=1000×A+x

∴ a % 8 = ( ( 1000  ⁣ ×  ⁣ A ) % 8 + x % 8 ) % 8 \therefore a \% 8 = ((1000\!\times\!A) \% 8 + x \% 8) \% 8 a%8=((1000×A)%8+x%8)%8

∵ 8 ∣ x \because 8 \mid x 8x

∴ 8 ∣ a \therefore 8 \mid a 8a


(4)设 a = a n a n − 1 … a 2 a 1 ‾ a = \overline{a_{n}a_{n - 1}\dots a_{2}a_{1}} a=a

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值