2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
id: 5900f3d91000cf542c50feeb
|
|
|
|
title: 'Problem 108: Diophantine Reciprocals I'
|
2020-11-27 19:02:05 +01:00
|
|
|
challengeType: 5
|
2019-08-05 09:17:33 -07:00
|
|
|
forumTopicId: 301732
|
2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --description--
|
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
In the following equation x, y, and n are positive integers.
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
1/`x` + 1/`y` = 1/`n`
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
For `n` = 4 there are exactly three distinct solutions:
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
1/5 + 1/20 = 1/4
|
|
|
|
1/6 + 1/12 = 1/4
|
|
|
|
1/8 + 1/8 = 1/4
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
What is the least value of `n` for which the number of distinct solutions exceeds one-thousand?
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --hints--
|
|
|
|
|
|
|
|
`diophantineOne()` should return 180180.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
```js
|
|
|
|
assert.strictEqual(diophantineOne(), 180180);
|
|
|
|
```
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --seed--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
## --seed-contents--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
```js
|
|
|
|
function diophantineOne() {
|
2020-09-15 09:57:40 -07:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
diophantineOne();
|
|
|
|
```
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --solutions--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|