2018-09-30 23:01:58 +01:00
---
id: 5900f3f51000cf542c50ff07
title: 'Problem 136: Singleton difference'
2020-11-27 19:02:05 +01:00
challengeType: 5
2019-08-05 09:17:33 -07:00
forumTopicId: 301764
2021-01-13 03:31:00 +01:00
dashedName: problem-136-singleton-difference
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
2021-07-16 21:38:37 +02:00
The positive integers, $x$, $y$, and $z$, are consecutive terms of an arithmetic progression. Given that $n$ is a positive integer, the equation, $x^2 − y^2 − z^2 = n$, has exactly one solution when $n = 20$:
2020-11-27 19:02:05 +01:00
2021-07-16 21:38:37 +02:00
$$13^2 − 10^2 − 7^2 = 20$$
2018-09-30 23:01:58 +01:00
2021-07-16 21:38:37 +02:00
In fact, there are twenty-five values of $n$ below one hundred for which the equation has a unique solution.
2018-09-30 23:01:58 +01:00
2021-07-16 21:38:37 +02:00
How many values of $n$ less than fifty million have exactly one solution?
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
# --hints--
2018-09-30 23:01:58 +01:00
2021-07-16 21:38:37 +02:00
`singletonDifference()` should return `2544559` .
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
2021-07-16 21:38:37 +02:00
assert.strictEqual(singletonDifference(), 2544559);
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
2021-07-16 21:38:37 +02:00
function singletonDifference() {
2020-09-15 09:57:40 -07:00
2018-09-30 23:01:58 +01:00
return true;
}
2021-07-16 21:38:37 +02:00
singletonDifference();
2018-09-30 23:01:58 +01:00
```
2020-11-27 19:02:05 +01:00
# --solutions--
2018-09-30 23:01:58 +01:00
```js
// solution required
```