Problem 66 » 履歴 » バージョン 1
Noppi, 2024/01/29 02:23
| 1 | 1 | Noppi | [ホーム](https://redmine.noppi.jp) - [[Wiki|Project Euler]] |
|---|---|---|---|
| 2 | # [[Problem 66]] |
||
| 3 | |||
| 4 | ## Diophantine Equation |
||
| 5 | Consider quadratic Diophantine equations of the form: |
||
| 6 | |||
| 7 | $$x^2 - Dy^2 = 1$$ |
||
| 8 | |||
| 9 | For example, when $D=13$, the minimal solution in $x$ is $649^2 - 13 \times 180^2 = 1$. |
||
| 10 | |||
| 11 | It can be assumed that there are no solutions in positive integers when $D$ is square. |
||
| 12 | |||
| 13 | <p>By finding minimal solutions in $x$ for $D = \{2, 3, 5, 6, 7\}$, we obtain the following:</p> |
||
| 14 | \begin{align} |
||
| 15 | 3^2 - 2 \times 2^2 &= 1\\ |
||
| 16 | 2^2 - 3 \times 1^2 &= 1\\ |
||
| 17 | {\color{red}{\mathbf 9}}^2 - 5 \times 4^2 &= 1\\ |
||
| 18 | 5^2 - 6 \times 2^2 &= 1\\ |
||
| 19 | 8^2 - 7 \times 3^2 &= 1 |
||
| 20 | \end{align} |
||
| 21 | |||
| 22 | Hence, by considering minimal solutions in $x$ for $D \le 7$, the largest $x$ is obtained when $D=5$. |
||
| 23 | |||
| 24 | Find the value of $D \le 1000$ in minimal solutions of $x$ for which the largest value of $x$ is obtained. |
||
| 25 | |||
| 26 | ## ディオファントス方程式 |
||
| 27 | 次の形式の, 2次のディオファントス方程式を考えよう: |
||
| 28 | |||
| 29 | $$x^2 - Dy^2 = 1$$ |
||
| 30 | |||
| 31 | たとえば D=13 のとき, x を最小にする解は 6492 - 131802 = 1 である. |
||
| 32 | |||
| 33 | D が平方数(square)のとき, 正整数のなかに解は存在しないと考えられる. |
||
| 34 | |||
| 35 | <p>D = {2, 3, 5, 6, 7} に対して x を最小にする解は次のようになる: |
||
| 36 | \begin{align} |
||
| 37 | 3^2 - 2 \times 2^2 &= 1\\ |
||
| 38 | 2^2 - 3 \times 1^2 &= 1\\ |
||
| 39 | {\color{red}{\mathbf 9}}^2 - 5 \times 4^2 &= 1\\ |
||
| 40 | 5^2 - 6 \times 2^2 &= 1\\ |
||
| 41 | 8^2 - 7 \times 3^2 &= 1 |
||
| 42 | \end{align} |
||
| 43 | </p> |
||
| 44 | |||
| 45 | したがって, D ≤ 7 に対して x を最小にする解を考えると, D=5 のとき x は最大である. |
||
| 46 | |||
| 47 | D ≤ 1000 に対する x を最小にする解で, x が最大になるような D の値を見つけよ. |
||
| 48 | |||
| 49 | ```scheme |
||
| 50 | ``` |