模运算在 AIME 中有着广泛的应用,特别是在处理大数时。掌握模运算的基本性质,是解决复杂数论问题的基础。
Modular arithmetic has wide applications in AIME, especially when dealing with large numbers. Mastering the basic properties of modular arithmetic is the foundation for solving complex number theory problems.
重要性质:
- 模运算中的加法、减法、乘法都是封闭的,但除法需要满足一定条件 Addition, subtraction, and multiplication in modular arithmetic are closed, but division requires certain conditions
- 如果 gcd(a, m) = 1,则 a 在模 m 下有逆元 If gcd(a, m) = 1, then a has an inverse modulo m
- 模运算可以用来简化大数的计算 Modular arithmetic can be used to simplify calculations with large numbers
例题 1 Example 1
计算 2 的幂模 10 的循环周期:
2¹ = 2 mod 10 = 2
2² = 4 mod 10 = 4
2³ = 8 mod 10 = 8
2⁴ = 16 mod 10 = 6
2⁵ = 32 mod 10 = 2
循环周期为 4。
2021 ÷ 4 = 505 余 1,所以 2^2021 ≡ 2¹ ≡ 2 mod 10。
Calculating the cycle of powers of 2 modulo 10: 2¹ ≡ 2, 2² ≡ 4, 2³ ≡ 8, 2⁴ ≡ 6, 2⁵ ≡ 2. The cycle length is 4. 2021 ÷ 4 = 505 remainder 1, so 2^2021 ≡ 2¹ ≡ 2 mod 10.
费马小定理和欧拉定理是模运算中的重要工具,在 AIME 中有着广泛的应用。这些定理可以用来简化指数运算,解决同余方程等问题。
Fermat's Little Theorem and Euler's Theorem are important tools in modular arithmetic and have wide applications in AIME. These theorems can be used to simplify exponentiation and solve congruence equations.
欧拉函数的性质:
- 如果 p 是质数,则 φ(p) = p - 1
- 如果 m = p^k,p 是质数,则 φ(m) = p^k - p^(k-1)
- 如果 m 和 n 互质,则 φ(mn) = φ(m)φ(n)
例题 2 Example 2
根据费马小定理,因为 7 是质数,且 3 与 7 互质,所以 3^6 ≡ 1 (mod 7)。
2019 ÷ 6 = 336 余 3,所以 3^2019 ≡ 3^3 ≡ 27 ≡ 6 mod 7。
By Fermat's Little Theorem, since 7 is prime and 3 is coprime to 7, we have 3^6 ≡ 1 (mod 7). 2019 ÷ 6 = 336 remainder 3, so 3^2019 ≡ 3^3 ≡ 27 ≡ 6 mod 7.
中国剩余定理(CRT)是解决同余方程组的重要工具,在 AIME 中经常出现。掌握中国剩余定理,对于解决复杂的数论问题非常重要。
The Chinese Remainder Theorem (CRT) is an important tool for solving systems of congruences and often appears in AIME. Mastering the Chinese Remainder Theorem is crucial for solving complex number theory problems.
中国剩余定理的应用步骤:
- 验证模数是否两两互质
- 计算 M = m₁m₂...m_k
- 对于每个 i,计算 M_i = M/m_i
- 计算 M_i 的模 m_i 逆元 t_i,即 M_i t_i ≡ 1 (mod m_i)
- 解为 x ≡ Σ(a_i M_i t_i) (mod M)
例题 3 Example 3
使用中国剩余定理求解:
m₁ = 3, m₂ = 4, m₃ = 5,两两互质。
M = 3 × 4 × 5 = 60
M₁ = 60/3 = 20, M₂ = 60/4 = 15, M₃ = 60/5 = 12
求逆元:
20t₁ ≡ 1 (mod 3) → 2t₁ ≡ 1 (mod 3) → t₁ = 2
15t₂ ≡ 1 (mod 4) → 3t₂ ≡ 1 (mod 4) → t₂ = 3
12t₃ ≡ 1 (mod 5) → 2t₃ ≡ 1 (mod 5) → t₃ = 3
解为:x ≡ (1×20×2 + 2×15×3 + 3×12×3) mod 60
计算:40 + 90 + 108 = 238
238 mod 60 = 58
Using Chinese Remainder Theorem: M = 3×4×5 = 60, M₁=20, M₂=15, M₃=12. Inverses: t₁=2, t₂=3, t₃=3. Solution: x ≡ (1×20×2 + 2×15×3 + 3×12×3) ≡ 238 ≡ 58 mod 60.
