🗺️ 知识地图
AIME 知识体系 数论基础 📝 丢番图方程 3 / 3

📝 丢番图方程

Diophantine Equations

丢番图方程是 AIME 数论中的重要内容,涉及线性丢番图方程、佩尔方程、勾股数等多个类型。掌握这些方程的解法,对于解决复杂的数论问题至关重要。

📖 3 章节 💡 4 道例题 🎯 难度:困难 ⏱ 约35分钟
1
线性丢番图方程 Linear Diophantine Equations
进阶 高频

线性丢番图方程是最基本的丢番图方程类型,形如 ax + by = c,其中 a、b、c 是整数,x、y 是整数未知数。在 AIME 中,经常需要求解线性丢番图方程的整数解。

Linear Diophantine equations are the most basic type of Diophantine equations, in the form ax + by = c, where a, b, c are integers, and x, y are integer unknowns. In AIME, we often need to find integer solutions to linear Diophantine equations.

📝 线性丢番图方程的解存在性 / Existence of Solutions for Linear Diophantine Equations
方程 ax + by = c 有整数解当且仅当 gcd(a, b) | c
设 d = gcd(a, b),如果 d 不整除 c,则方程无整数解
如果 d | c,则方程有无穷多组整数解
The equation ax + by = c has integer solutions if and only if gcd(a, b) divides c

求解线性丢番图方程的步骤:

  1. 计算 d = gcd(a, b),检查 d 是否整除 c
  2. 使用扩展欧几里得算法找到一组特解 (x₀, y₀)
  3. 所有解的形式为:x = x₀ + (b/d)t, y = y₀ - (a/d)t,其中 t 是整数
💡 提示: 扩展欧几里得算法是求解线性丢番图方程的关键工具,需要熟练掌握。

例题 1 Example 1

📝 AIME 2020 I Problem 2 难度:中等
求方程 3x + 5y = 2020 的正整数解的个数。 Find the number of positive integer solutions to the equation 3x + 5y = 2020.
解答:

首先,计算 gcd(3, 5) = 1,1 整除 2020,所以方程有解。

使用扩展欧几里得算法找到一组特解:

5 = 3 × 1 + 2

3 = 2 × 1 + 1

2 = 1 × 2 + 0

回代得:1 = 3 - 2 × 1 = 3 - (5 - 3 × 1) × 1 = 2 × 3 - 1 × 5

所以 2020 = 2020 × 1 = 2020 × (2 × 3 - 1 × 5) = 4040 × 3 - 2020 × 5

特解为 x₀ = 4040, y₀ = -2020

通解为 x = 4040 - 5t, y = -2020 + 3t

要求正整数解,所以:

4040 - 5t > 0 → t < 808

-2020 + 3t > 0 → t > 2020/3 ≈ 673.33

所以 t 的取值范围是 674 ≤ t ≤ 807,共 807 - 674 + 1 = 134 个解。

First, gcd(3, 5) = 1, which divides 2020, so solutions exist. Using extended Euclidean algorithm, we find a particular solution: 2020 = 4040 × 3 - 2020 × 5. General solution: x = 4040 - 5t, y = -2020 + 3t. For positive solutions: 674 ≤ t ≤ 807, total 134 solutions.

💡 关键思路: 利用扩展欧几里得算法找到特解,然后通过通解公式找到正整数解的范围。
2
佩尔方程 Pell's Equation
困难 选考

佩尔方程是形如 x² - Dy² = 1 的二次不定方程,其中 D 是正整数且不是完全平方数。佩尔方程在 AIME 中偶尔出现,需要掌握其基本解法。

Pell's equation is a type of quadratic Diophantine equation in the form x² - Dy² = 1, where D is a positive integer that is not a perfect square. Pell's equation occasionally appears in AIME, and its basic solution method needs to be mastered.

📝 佩尔方程的基本性质 / Basic Properties of Pell's Equation
方程 x² - Dy² = 1 总是有非平凡解(即 x, y ≠ 0)
设 (x₁, y₁) 是最小的正整数解(基本解),则所有解可以表示为:
x + y√D = (x₁ + y₁√D)^n,其中 n 是正整数
The equation x² - Dy² = 1 always has non-trivial solutions (x, y ≠ 0)

求解佩尔方程的步骤:

  1. 验证 D 是否为非平方正整数
  2. 使用连分数法或试算法找到基本解 (x₁, y₁)
  3. 通过基本解生成所有解
⚠️ 注意: 佩尔方程的基本解可能非常大,需要谨慎计算。在 AIME 中,通常只需要找到基本解或前几个解。

例题 2 Example 2

📝 AIME 2017 II Problem 6 难度:困难
求方程 x² - 2y² = 1 的最小正整数解。 Find the smallest positive integer solution to the equation x² - 2y² = 1.
解答:

通过试算法寻找最小正整数解:

当 y=1 时,x² = 1 + 2×1 = 3,不是平方数

当 y=2 时,x² = 1 + 2×4 = 9,x=3,符合条件

所以最小正整数解是 (3, 2)。

By trial method: For y=1, x²=3 (not a square); for y=2, x²=9 (x=3). So the smallest positive integer solution is (3, 2).

💡 关键思路: 对于小的 D 值,试算法是寻找基本解的有效方法。
3
勾股数与其他二次丢番图方程 Pythagorean Triples and Other Quadratic Diophantine Equations
进阶 高频

勾股数是指满足 a² + b² = c² 的正整数三元组 (a, b, c)。勾股数在 AIME 中经常出现,需要掌握其性质和生成方法。

Pythagorean triples are sets of three positive integers (a, b, c) that satisfy a² + b² = c². Pythagorean triples often appear in AIME, and their properties and generation methods need to be mastered.

📝 勾股数的生成公式 / Pythagorean Triple Generation Formula
设 m > n > 0 是互质的正整数,且一奇一偶,则:
a = m² - n²
b = 2mn
c = m² + n²
生成的 (a, b, c) 是本原勾股数(即 a, b, c 互质)
Let m > n > 0 be coprime positive integers of opposite parity, then (m² - n², 2mn, m² + n²) is a primitive Pythagorean triple

勾股数的性质:

  • 本原勾股数中,必有一个数是 3 的倍数,一个数是 4 的倍数,一个数是 5 的倍数
  • 所有勾股数都是本原勾股数的倍数
  • 勾股数可以无限生成
💡 提示: 勾股数在几何问题中经常出现,特别是在涉及直角三角形的问题中。

例题 3 Example 3

📝 AIME 2016 I Problem 5 难度:中等
求最小的正整数 n,使得 n, n+1, n+2 是勾股数。 Find the smallest positive integer n such that n, n+1, n+2 are a Pythagorean triple.
解答:

根据勾股数的定义,我们需要满足:

n² + (n+1)² = (n+2)²

展开得:n² + n² + 2n + 1 = n² + 4n + 4

化简得:n² - 2n - 3 = 0

解得:n = 3 或 n = -1(舍去负数解)

验证:3² + 4² = 9 + 16 = 25 = 5²,符合条件。

By the definition of Pythagorean triple: n² + (n+1)² = (n+2)². Expanding and simplifying: n² - 2n - 3 = 0. Solving: n=3. Verification: 3² + 4² = 5², which is correct.

💡 关键思路: 利用勾股数的定义建立方程,然后求解得到最小的正整数解。

综合练习

练习题 1: 求方程 4x + 6y = 20 的正整数解的个数。 Find the number of positive integer solutions to the equation 4x + 6y = 20.
✅ 回答正确!
❌ 回答错误,请再试一次。
练习题 2: 求方程 x² - 3y² = 1 的最小正整数解。 Find the smallest positive integer solution to the equation x² - 3y² = 1.
✅ 回答正确!
❌ 回答错误,请再试一次。
练习题 3: 求最小的正整数 n,使得 n, n+2, n+4 是勾股数。 Find the smallest positive integer n such that n, n+2, n+4 are a Pythagorean triple.
✅ 回答正确!
❌ 回答错误,请再试一次。