Học tập / Giai đoạn 1 · Lớp 6–7: Nền móng
Lesson 4. GCD and your first Diophantine equationsLesson 4. GCD and your first Diophantine equations
🧭 Chủ đề:Topic: Số học: chia hết, số nguyên tốNumber theory · xem bài cùng chủ đề ở mọi độ tuổisee this topic at every age
🎯 Sau bài này bạn sẽ
Dùng thuật toán Euclid tìm ƯCLN Giải phương trình dạng $xy = k$ và $ax + by = c$ trong số nguyên
Use the Euclidean algorithm to find the GCD Solve equations of the form $xy = k$ and $ax + by = c$ in integers
Thuật toán Euclid: $\gcd(a, b) = \gcd(b, a \bmod b)$. Ví dụ $\gcd(84, 36) = \gcd(36, 12) = \gcd(12, 0) = 12$.
Dạng 1 — Đưa về tích
Tìm số nguyên dương $x, y$ với $xy - x - y = 2$. Thêm 1 vào hai vế: $xy - x - y + 1 = 3$ hay $(x - 1)(y - 1) = 3$. Vì $3 = 1 \cdot 3 = 3 \cdot 1$ nên $(x, y) = (2, 4)$ hoặc $(4, 2)$.
Kỹ thuật “thêm bớt để phân tích nhân tử” là chìa khóa của rất nhiều bài nghiệm nguyên.
Dạng 2 — Phương trình bậc nhất $ax + by = c$
Phương trình có nghiệm nguyên khi và chỉ khi $\gcd(a, b)$ chia hết $c$. Ví dụ $6x + 9y = 20$ vô nghiệm nguyên vì $\gcd(6, 9) = 3$ không chia hết 20.
Tìm nghiệm nguyên dương của $3x + 5y = 31$: thử $y = 1, 2, \ldots$: $y = 2 \Rightarrow x = 7$; $y = 5 \Rightarrow x = 2$. Các nghiệm cách nhau đều: $x$ giảm 5 khi $y$ tăng 3.
Bài toán từ IMO
🏅 IMO 1981 — Bài 3
Tìm giá trị lớn nhất của $m^2 + n^2$, trong đó $m, n$ là các số nguyên thuộc $\{1, 2, \dots, 1981\}$ thỏa mãn $(n^2 - mn - m^2)^2 = 1$.
Lời giải (hãy tự làm ít nhất 30 phút trước khi mở)
Bước lùi (giống thuật toán Euclid). Nếu $(m, n)$ là nghiệm với $n > m$, thì $(n - m, m)$ cũng là nghiệm, vì $$m^2 - m(n - m) - (n - m)^2 = -(n^2 - mn - m^2).$$ Nếu $n = m$ thì $(n^2 - mn - m^2)^2 = m^4 = 1$, nên $m = n = 1$. Còn $n < m$ thì không xảy ra, vì khi đó $n^2 - mn - m^2 = n(n - m) - m^2 < -m^2 le -1$.
Lùi mãi sẽ về $(1, 1)$. Đi ngược lại, mọi nghiệm có dạng hai số Fibonacci liên tiếp: $(1,1), (1,2), (2,3), (3,5), (5,8), \dots$
Các số Fibonacci không vượt quá 1981: $\dots, 610, 987, 1597$ (số tiếp theo là 2584). Vậy giá trị lớn nhất là $987^2 + 1597^2 = 3\,524\,578$. $\blacksquare$
The Euclidean algorithm: $\gcd(a, b) = \gcd(b, a \bmod b)$. For example $\gcd(84, 36) = \gcd(36, 12) = \gcd(12, 0) = 12$.
Type 1 — Factorise
Find positive integers $x, y$ with $xy - x - y = 2$. Add 1 to both sides: $xy - x - y + 1 = 3$, i.e. $(x - 1)(y - 1) = 3$. Since $3 = 1 \cdot 3 = 3 \cdot 1$, $(x, y) = (2, 4)$ or $(4, 2)$.
“Add and subtract to factorise” is the key to a great many integer equations.
Type 2 — Linear equations $ax + by = c$
The equation has integer solutions if and only if $\gcd(a, b)$ divides $c$. For example $6x + 9y = 20$ has no integer solutions because $\gcd(6, 9) = 3$ does not divide 20.
Positive solutions of $3x + 5y = 31$: try $y = 1, 2, \ldots$: $y = 2 \Rightarrow x = 7$; $y = 5 \Rightarrow x = 2$. Solutions are evenly spaced: $x$ drops by 5 when $y$ rises by 3.
A problem from the IMO
🏅 IMO 1981 — Problem 3
Determine the maximum value of $m^2 + n^2$, where $m, n$ are integers in $\{1, 2, \dots, 1981\}$ satisfying $(n^2 - mn - m^2)^2 = 1$.
Solution (try it yourself for at least 30 minutes before opening)
Step down (like the Euclidean algorithm). If $(m, n)$ is a solution with $n > m$, then $(n - m, m)$ is also a solution, because $$m^2 - m(n - m) - (n - m)^2 = -(n^2 - mn - m^2).$$ If $n = m$ then $(n^2 - mn - m^2)^2 = m^4 = 1$, so $m = n = 1$. And $n < m$ is impossible, because then $n^2 - mn - m^2 = n(n - m) - m^2 < -m^2 \le -1$.
Stepping down always ends at $(1, 1)$. Reversing the steps, every solution is a pair of consecutive Fibonacci numbers: $(1,1), (1,2), (2,3), (3,5), (5,8), \dots$
The Fibonacci numbers up to 1981 end with $\dots, 610, 987, 1597$ (the next is 2584). So the maximum is $987^2 + 1597^2 = 3\,524\,578$. $\blacksquare$
Bình luận (0)
Chưa có bình luận nào. Hãy là người đầu tiên!