Pell’s Equation佩尔方程 Indeterminate equations不定方程[C Done]

1. Standard Definition of Pell’s Equation

The classic Pell’s equation is a Diophantine equation (an equation requiring integer solutions) with this fixed form:

\(\boldsymbol{x^2 – Dy^2 = 1}\)

Restrictions on D:

  • D is a positive integer that is square-free (cannot be written as \(k^2\) times another integer).
  • If D is a perfect square, the equation only has trivial solution \(x=\pm1,\ y=0\), no positive integer pairs \((x,y)\).

2. Fundamental Solution

Definition

The fundamental solution\((x_1,\ y_1)\) is the smallest pair of positive integers \((x,y)\) that satisfies the Pell’s equation.

Example

For our problem \(x^2 – 8y^2 = 1\):

Test small y values, \(y=1\) gives \(x^2=1+8=9\), so \(x=3\).

Fundamental solution: \((x_1,y_1)=(3,1)\).

3. Two Forms of General Solutions (Memorizable Formulas)

All positive integer solutions of Pell’s equation can be generated from its fundamental solution. There are two equivalent formulas for memorization.

Form 1: Radical Power Form (Theoretical Core, easiest to remember)

Let \(\alpha = x_1 + y_1\sqrt{D}\) (built from the fundamental solution).

For every positive integer exponent \(m = 1,2,3,\dots\):

\(\boldsymbol{\alpha^m = (x_1 + y_1\sqrt{D})^m = x_m + y_m\sqrt{D}}\)

The rational part \(x_m\) and irrational coefficient \(y_m\) form the m-th solution pair \((x_m,\ y_m)\).

Form 2: Linear Recurrence Formula (Pure integers, no radicals, good for calculation)

Once you have the fundamental solution \((x_1,y_1)\), subsequent solutions follow these recurrence relations: \(\begin{cases} \boldsymbol{x_{m+1} = x_1 x_m + D y_1 y_m} \\ \boldsymbol{y_{m+1} = x_1 y_m + y_1 x_m} \end{cases}\)

4. Quick Recap Cheat Sheet (For Memorizing)

  1. Standard Pell’s Equation: \(x^2 – Dy^2 = 1,\ D>0,\text{square-free}\)
  2. Fundamental solution: minimal positive \((x_1,y_1)\) satisfying the equation
  3. All solutions via power: \((x_1+y_1\sqrt{D})^m = x_m + y_m\sqrt{D}\)
  4. Recurrence to compute new solutions:\(x_{m+1}=x_1x_m+Dy_1y_m,\quad y_{m+1}=x_1y_m+y_1x_m\)

好问题!咱们先把概念掰清楚,再按”次数”一层层展开。


一、先搞清:什么叫「不定方程」?

不定方程的核心不是”长得奇怪”,而是:

未知数的个数 > 独立方程的个数

所以方程的解不唯一,往往有无穷多个;而我们通常关心的是整数解(或正整数解),这就叫丢番图方程(Diophantine equation)

比如:

  • x + y = 5​ —— 两个未知数,一个方程 → 不定 ✓
  • x² + y² = z²​ —— 三个未知数,一个方程 → 不定 ✓(这就是勾股数的来源)
  • 2x + 3y = 7,x − y = 1​ —— 两个方程两个未知数 → 一般确定,不算不定

二、按「次数」分——你说的对,大致就是这样

📌 1. 一次不定方程(线性丢番图方程)

一般形式:

a1​x1​+a2​x2​+⋯+an​xn​=c

最经典的两元一次:

ax+by=c(a,b,c∈Z)

关键结论:

有整数解 ⇔ gcd(a, b) | c(c 能被 a,b 的最大公约数整除)

怎么求通解?

先用扩展欧几里得算法找出一组特解 (x0​,y0​),然后通解是:

x=x0​+db​⋅t,y=y0​−da​⋅t(t∈Z, d=gcd(a,b))

例子:​ 3x+5y=7

  • gcd(3,5)=1,1|7 ✓ 有解
  • 特解:x=−1,y=2(因为 −3+10=7)
  • 通解:x=−1+5t, y=2−3t

这个类型最”规矩”——有完整的通解公式,能系统地做。


📌 2. 二次不定方程(最精彩的一层)

形式里最高次项是二次的,比如 x2、xy、y2等。

① 两变量二次型

Ax2+Bxy+Cy2+Dx+Ey+F=0

这类没有统一的通解公式,但有几条大路:

经典A:勾股方程

x2+y2=z2

全部正整数解的结构是:

x=k(m2−n2),y=k(2mn),z=k(m2+n2)

其中 m>n>0,gcd(m,n)=1,m,n一奇一偶,k∈N+

这就是毕达哥拉斯三元组!

经典B:佩尔方程(Pell’s Equation)

x2−Dy2=N(D>0 不是完全平方数)

最常见是 x2−Dy2=1,它的正整数解有无限多个,而且可以用连分数把解全部生成出来——超级漂亮的结构。

例:x2−2y2=1

  • 最小解:(3,2)因为 9−8=1
  • 后面所有解由 (3+22​)n展开得到:(17,12),(99,70),…

经典C:椭圆曲线型

y2=x3+ax+b

这已经是现代数论的核心了(费马大定理的证明就绕到这里),解的数量有限但结构极深。


📌 3. 三次及更高次不定方程

xn+yn=zn(n≥3)

这就是著名的费马大定理:当 n≥3时,没有正整数解 (x,y,z)全非零。怀尔斯1994年证明的,是整个20世纪数学的巅峰之一。

更高次的通常:

  • 解极少甚至没有(很多情况已被证明有限)
  • 没有通用解法,每个方程几乎都是单独啃的硬骨头

三、换个角度看:按「未知数 vs 方程个数」

情形含义例子
n个未知数,1个方程“高度不定”,靠数论约束筛解x2+y2=z2
n个未知数,n−1个方程可消元化成1~2个变量联立后变二次
指数型:ax+by=cz已经不是多项式次数框架了卡塔兰猜想 32−23=1

四、一句话总结

一次不定方程→有完整通解公式(扩欧);

二次不定方程→没有万能公式,但有经典家族(勾股数 / Pell方程 / 椭圆曲线),每个家族有自己的生成结构;

三次及以上→基本进入”每个方程都是独特战役”的深水区,解通常极少,靠深刻的数论工具。

佩尔方程基础例题

标准佩尔方程形式:

\(x^2 – Dy^2 = 1\)

其中 D 是不含平方因子的正整数。

核心结论:找到一组最小正整数解 \((x_1,y_1)\)(基本解),所有正整数解满足:

\(x_n+y_n\sqrt{D}=(x_1+y_1\sqrt{D})^n,\quad n=1,2,3\cdots\)

也可以用整数递推公式快速计算下一组解: \(\begin{cases} x_{n+1}=x_1 x_n + D y_1 y_n \\ y_{n+1}=x_1 y_n + y_1 x_n \end{cases}\)

例 1:\(x^2 – 2y^2 = 1\)

  1. 寻找最小正整数解:从小到大试 y:\(y=1,x^2=3\) 无解;\(y=2,x^2=1+8=9 \Rightarrow x=3\)基本解:\((x_1,y_1)=(3,2)\)
  2. 验证:\(3^2-2\times 2^2=9-8=1\),成立。
  3. 求第二组解(\(n=2\)):\((3+2\sqrt{2})^2=3^2+2\cdot3\cdot2\sqrt{2}+(2\sqrt{2})^2=17+12\sqrt{2}\)第二组解:\((17,12)\)
  4. 验证:\(17^2-2\times12^2=289-288=1\),成立。

例 2:\(x^2 – 3y^2 = 1\)

  1. 寻找最小解:\(y=1,\ x^2=1+3=4\Rightarrow x=2\)基本解:\((2,1)\)
  2. 验证:\(2^2-3\times1^2=4-3=1\)
  3. 第二组解:\((2+\sqrt{3})^2=7+4\sqrt{3}\)解:\((7,4)\)
  4. 验证:\(7^2-3\times4^2=49-48=1\)

例 3:\(x^2 – 5y^2 = 1\)

  1. 寻找最小解:\(y=1,2,3\) 均无解;\(y=4,\ x^2=1+5\times16=81\Rightarrow x=9\)基本解:\((9,4)\)
  2. 验证:\(9^2-5\times4^2=81-80=1\)
  3. 第二组解:\((9+4\sqrt{5})^2=161+72\sqrt{5}\)解:\((161,72)\)
  4. 验证:\(161^2-5\times72^2=25921-25920=1\)

例 4:\(x^2 – 7y^2 = 1\)

  1. 寻找最小解:\(y=1,2\) 无解;\(y=3,\ x^2=1+7\times9=64\Rightarrow x=8\)基本解:\((8,3)\)
  2. 验证:\(8^2-7\times3^2=64-63=1\)
  3. 第二组解:\((8+3\sqrt{7})^2=127+48\sqrt{7}\)解:\((127,48)\)
  4. 验证:\(127^2-7\times48^2=16129-16128=1\)

补充小结论

  1. 若 D 是完全平方数(如 \(D=4,9\)),佩尔方程 \(x^2-Dy^2=1\) 无正整数解
  2. 只要 D 无平方因子,方程一定存在无穷多组正整数解;
  3. 不用开根号:用递推公式可以批量生成解。以 \(D=2,x_1=3,y_1=2\) 举例:

\(x_2=3\cdot3+2\cdot2\cdot2=17,\quad y_2=3\cdot2+2\cdot3=12\)

和前面计算结果完全一致。

Q1 2022 AMC 12A Problems/Problem 16

$\emph{triangular number}$ is a positive integer that can be expressed in the form $t_n = 1+2+3+\cdots+n$, for some positive integer $n$. The three smallest triangular numbers that are also perfect squares are $t_1 = 1 = 1^2$$t_8 = 36 = 6^2$, and $t_{49} = 1225 = 35^2$. What is the sum of the digits of the fourth smallest triangular number that is also a perfect square?

$\textbf{(A) } 6 \qquad \textbf{(B) } 9 \qquad \textbf{(C) } 12 \qquad \textbf{(D) } 18 \qquad \textbf{(E) } 27$

Q2 2008 AIME II Problems/Problem 15

Find the largest integer n satisfying the following conditions:

(i) n^2 can be expressed as the difference of two consecutive cubes;

(ii)  2n+79 is a perfect square.

Q2在构造佩尔方程的时候,不能死盯着x的系数为1,换成n的系数为一,让x平方的系数变成D,佩尔方程就构造成功了。

评论

Leave a Reply