Example: Please proof the following reducibility of modular arithmetic,i.e.
Proof: ∵a=r1*n+q1, b=r2*n+q2,
左边式子:(a+b) mod n=[( r1*n+q1)+( r2*n+q2)] mod n
=(0+0+q1+q2)mod n
=( q1+q2)modn
右边式子:[(amod n)+(b mod n)] mod n
=[((r1*n+q1) mod n)+((r2*n+q2)mod n)] mod n
=(q1+q2)modn
∴左边等于右边,也即(a+b)mod n=[(a mod n)+(b mod n)]mod n
Proof: ∵a=r1*n+q1, b=r2*n+q2,
左边式子:(a*b) mod n=[( r1*n+q1)*( r2*n+q2)] mod n
=(r1*r2*n2+r1*q2*n+r2*q1*n+q1*q2)modn
=(0+0+0+q1*q2)mod n
=( q1*q2)modn
右边式子:[(amod n)*(b mod n)] mod n
=[((r1*n+q1) mod n)*((r2*n+q2)mod n)] mod n
=(q1*q2)modn
∴左边等于右边,也即(a*b)mod n=[(a mod n)*(b mod n)]mod n
Example:Please computer 27357mod 17
Ans: 6
27357 mod 17
=[(27mod17) 357] mod 17=(10357)mod 17=(10256+64+32+4+1)mod 17
=[(10256mod17)*(1064mod17)*(1032mod17)*(104mod17)*(101mod17)]mod17
=[(10256mod17)*(1064mod17)*(1032mod17)*(104mod17)*(10)]mod17
=[(10256mod17)*(1064mod17)*(1032mod17)*(102mod17)*(102mod17)*(10)]mod 17
=[(10256mod17)*(1064mod17)*(1032mod17)*(15)*(15)*(10)]mod 17
=[(10256mod17)*(1064mod17)*(1032mod17)*((15*15)mod 17)*(10)]mod 17
=[(10256mod17)*(1064mod17)*(1032mod17)*(4)*(10)]mod17
=[(10256mod17)*(1064mod17)*((104mod17)8mod 17)*(4)*(10)]mod 17
=[(10256mod17)*(1064mod17)*(48mod 17)*(4)*(10)]mod 17
=[(10256mod17)*(1064mod17)*(1)*(4)*(10)]mod17
=[(10256mod17)*(1032mod17)*(1032mod17)*(1)*(4)*(10)]mod 17
=[(10256mod17)*(1*1 mod 17)*(1)*(4)*(10)]mod17
=[(10256mod17)*(1)*(1)*(4)*(10)]mod17
=[((1064mod17)4 mod17)* (1)*(1)*(4)*(10)]mod 17
=[((1)4 mod 17)* (1)*(1)*(4)*(10)]mod17
=[(1)* (1)*(1)*(4)*(10)]mod 17=[(1)* (1)*(1)*(4*10)mod17]mod 17
=[(40)mod 17]mod 17=6 mod 17
= 6
a+b=0(mod n)
在模运算中,每一个整数都有一个加法逆,它们之和模n为0
Let x ∈ Zn. If there is an integer y ∈ Zn such that x n y = 1.
The integer y is called the multiplicative inverse of x, usually denoted x−1.
在集合Zn中,若g(n,a)=1时,a有一个乘法逆。