佩尔方程

什么是佩尔方程

$$x^2-Dy^2 = 1,\ D \in \mathbb{N}^+$$

佩尔方程的解

如果 $D$ 是完全平方数,则方程只有平凡解: $(\pm 1, 0)$.

如果 $D$ 不是平方数,设 $(x_1, y_1)$ 和 $(x_2, y_2)$ 是上述方程的两个解,那么 $(x_1x_2 + y_1y_2*D, \ x_1y_2, x_2y_1)$ 也是方程的一组解。

则方程解的递推式为:

$$\begin{cases}
x_n = x_{n-1}*x_1 + y_{n-1}*y_1*D & \\
y_n = x_{n-1}*y_1 + y_{n-1}*x_1 &
\end{cases}$$

规模较大时,可以打表或者矩阵快速幂解决。

最小特解

由上面递推的方法知,需要先求得一组特解。

可以暴力枚举,也可以用连分数法

nxynxynxy
1 - - 33 23 4 65 129 16
2 3 2 34 35 6 66 65 8
3 2 1 35 6 1 67 48842 5967
4 - - 36 - - 68 33 4
5 9 4 37 73 12 69 7775 936
6 5 2 38 37 6 70 251 30
7 8 3 39 25 4 71 3480 413
8 3 1 40 19 3 72 17 2
9 - - 41 2049 320 73 2281249 267000
10 19 6 42 13 2 74 3699 430
11 10 3 43 3482 531 75 26 3
12 7 2 44 199 30 76 57799 6630
13 649 180 45 161 24 77 351 40
14 15 4 46 24335 3588 78 53 6
15 4 1 47 48 7 79 80 9
16 - - 48 7 1 80 9 1
17 33 8 49 - - 81 - -
18 17 4 50 99 14 82 163 18
19 170 39 51 50 7 83 82 9
20 9 2 52 649 90 84 55 6
21 55 12 53 66249 9100 85 285769 30996
22 197 42 54 485 66 86 10405 1122
23 24 5 55 89 12 87 28 3
24 5 1 56 15 2 88 197 21
25 - - 57 151 20 89 500001 53000
26 51 10 58 19603 2574 90 19 2
27 26 5 59 530 69 91 1574 165
28 127 24 60 31 4 92 1151 120
29 9801 1820 61 1766319049 226153980 93 12151 1260
30 11 2 62 63 8 94 2143295 221064
31 1520 273 63 8 1 95 39 4
32 17 3 64 - - 96 49 5

这是一些最小解,

如果取使得 $x$ 单调递增的 $D$组成序列,就是 OEIS:A033316.

佩尔方程的变形

1、$x^2-ny^2=-1$

可以两边平方:

$(x^2-ny^2)^2 = (-1)^2$

$(x^2+ny^2) - n*(2xy)^2 = 1$

此外,使得方程有解的 $n$ 的序列:

OEIS A031396: 1, 2, 5, 10, 13, 17, 26, 29, 37...

2、$x^2 - ny^2 = \pm 2$

同样平方得:$(x^2+ny^2)-n(2xy)^2 = 4$.

因为 $ny^2 = x^2 \pm 2$, 代入,$(x^2 \pm 1)^2 - n(xy)^2=1$.

3、佩尔型方程

$x^2-ny^2=1$

附:

一个在线解佩尔方程的网站:http://www.numbertheory.org/php/pell.html

 

 

参考链接:

1. https://blog.csdn.net/alusang/article/details/81266923#commentsedit

2. http://blog.sina.com.cn/s/blog_5d06e2390100ll92.html

3. https://en.wikipedia.org/wiki/Pell%27s_equation#History

 

posted @ 2019-10-11 10:16  Rogn  阅读(1121)  评论(0编辑  收藏  举报