mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-02-25 23:01:26 -05:00
45 lines
805 B
Markdown
45 lines
805 B
Markdown
---
|
||
id: 5900f3f51000cf542c50ff07
|
||
title: 'Problem 136: Singleton difference'
|
||
challengeType: 1
|
||
forumTopicId: 301764
|
||
dashedName: problem-136-singleton-difference
|
||
---
|
||
|
||
# --description--
|
||
|
||
正整数 $x$、$y$ 和 $z$ 是算术级数的连续项。 已知 $n$ 为正整数,对于方程 $x^2 − y^2 − z^2 = n$,当 $n = 20$ 时存在唯一解:
|
||
|
||
$$13^2 − 10^2 − 7^2 = 20$$
|
||
|
||
事实上,有 25 个 $n$ 小于 100 的值,使得方程有唯一解。
|
||
|
||
有多少小于五千万的 $n$ 使得方程有唯一解?
|
||
|
||
# --hints--
|
||
|
||
`singletonDifference()` 应该返回 `2544559`。
|
||
|
||
```js
|
||
assert.strictEqual(singletonDifference(), 2544559);
|
||
```
|
||
|
||
# --seed--
|
||
|
||
## --seed-contents--
|
||
|
||
```js
|
||
function singletonDifference() {
|
||
|
||
return true;
|
||
}
|
||
|
||
singletonDifference();
|
||
```
|
||
|
||
# --solutions--
|
||
|
||
```js
|
||
// solution required
|
||
```
|