45 lines
952 B
Markdown
45 lines
952 B
Markdown
![]() |
---
|
|||
|
id: 5900f3f51000cf542c50ff07
|
|||
|
title: '問題 136: 単体の差違'
|
|||
|
challengeType: 5
|
|||
|
forumTopicId: 301764
|
|||
|
dashedName: problem-136-singleton-difference
|
|||
|
---
|
|||
|
|
|||
|
# --description--
|
|||
|
|
|||
|
正の整数 $x$, $y$, $z$ は等差数列の連続項です。 $n$ を正の整数とすると、式 $x^2 − y^2 − z^2 = n$ は、$n = 20$ のときちょうど 1 つの解を持ちます。
|
|||
|
|
|||
|
$$13^2 − 10^2 − 7^2 = 20$$
|
|||
|
|
|||
|
実は、この式の解が 1 つのみになるような $n$ の値は 100 未満で 25 個あります。
|
|||
|
|
|||
|
この等式の解がちょうど 1 つになるような、5000 万未満 の $n$ の値はいくつありますか。
|
|||
|
|
|||
|
# --hints--
|
|||
|
|
|||
|
`singletonDifference()` は `2544559` を返す必要があります。
|
|||
|
|
|||
|
```js
|
|||
|
assert.strictEqual(singletonDifference(), 2544559);
|
|||
|
```
|
|||
|
|
|||
|
# --seed--
|
|||
|
|
|||
|
## --seed-contents--
|
|||
|
|
|||
|
```js
|
|||
|
function singletonDifference() {
|
|||
|
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
singletonDifference();
|
|||
|
```
|
|||
|
|
|||
|
# --solutions--
|
|||
|
|
|||
|
```js
|
|||
|
// solution required
|
|||
|
```
|