2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f4091000cf542c50ff1c
|
|
|
|
title: 'Problem 157: Solving the diophantine equation'
|
2020-11-27 18:02:05 +00:00
|
|
|
challengeType: 5
|
2019-08-05 16:17:33 +00:00
|
|
|
forumTopicId: 301788
|
2021-01-13 02:31:00 +00:00
|
|
|
dashedName: problem-157-solving-the-diophantine-equation
|
2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --description--
|
|
|
|
|
2021-07-14 11:05:12 +00:00
|
|
|
Consider the diophantine equation $\frac{1}{a} + \frac{1}{b} = \frac{p}{{10}^n}$ with $a$, $b$, $p$, $n$ positive integers and $a ≤ b$.
|
|
|
|
|
|
|
|
For $n = 1$ this equation has 20 solutions that are listed below:
|
|
|
|
|
|
|
|
$$\begin{array}{lllll}
|
|
|
|
\frac{1}{1} + \frac{1}{1} = \frac{20}{10} & \frac{1}{1} + \frac{1}{2} = \frac{15}{10}
|
|
|
|
& \frac{1}{1} + \frac{1}{5} = \frac{12}{10} & \frac{1}{1} + \frac{1}{10} = \frac{11}{10}
|
|
|
|
& \frac{1}{2} + \frac{1}{2} = \frac{10}{10} \\\\
|
|
|
|
\frac{1}{2} + \frac{1}{5} = \frac{7}{10} & \frac{1}{2} + \frac{1}{10} = \frac{6}{10}
|
|
|
|
& \frac{1}{3} + \frac{1}{6} = \frac{5}{10} & \frac{1}{3} + \frac{1}{15} = \frac{4}{10}
|
|
|
|
& \frac{1}{4} + \frac{1}{4} = \frac{5}{10} \\\\
|
|
|
|
\frac{1}{4} + \frac{1}{4} = \frac{5}{10} & \frac{1}{5} + \frac{1}{5} = \frac{4}{10}
|
|
|
|
& \frac{1}{5} + \frac{1}{10} = \frac{3}{10} & \frac{1}{6} + \frac{1}{30} = \frac{2}{10}
|
|
|
|
& \frac{1}{10} + \frac{1}{10} = \frac{2}{10} \\\\
|
|
|
|
\frac{1}{11} + \frac{1}{110} = \frac{1}{10} & \frac{1}{12} + \frac{1}{60} = \frac{1}{10}
|
|
|
|
& \frac{1}{14} + \frac{1}{35} = \frac{1}{10} & \frac{1}{15} + \frac{1}{30} = \frac{1}{10}
|
|
|
|
& \frac{1}{20} + \frac{1}{20} = \frac{1}{10}
|
|
|
|
\end{array}$$
|
|
|
|
|
|
|
|
How many solutions has this equation for $1 ≤ n ≤ 9$?
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --hints--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2021-07-14 11:05:12 +00:00
|
|
|
`diophantineEquation()` should return `53490`.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
```js
|
2021-07-14 11:05:12 +00:00
|
|
|
assert.strictEqual(diophantineEquation(), 53490);
|
2018-09-30 22:01:58 +00:00
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --seed--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
## --seed-contents--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
2021-07-14 11:05:12 +00:00
|
|
|
function diophantineEquation() {
|
2020-09-15 16:57:40 +00:00
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-07-14 11:05:12 +00:00
|
|
|
diophantineEquation();
|
2018-09-30 22:01:58 +00:00
|
|
|
```
|
|
|
|
|
2020-11-27 18:02:05 +00:00
|
|
|
# --solutions--
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|