47 lines
1.1 KiB
Markdown
47 lines
1.1 KiB
Markdown
---
|
||
id: 5900f3f91000cf542c50ff0b
|
||
title: '问题 141:累进平方数 n'
|
||
challengeType: 5
|
||
forumTopicId: 301770
|
||
dashedName: problem-141-investigating-progressive-numbers-n-which-are-also-square
|
||
---
|
||
|
||
# --description--
|
||
|
||
一个正整数 $n$ 除以 $d$ 后得到商 $q$ 和余数 $r$。 同时 $d$,$q$ 和 $r$ 是一个等比数列中三个连续的正整数项,但顺序不要求一致。
|
||
|
||
例如,58 除以 6 后得到商 9 和余数 4。 可以发现,4、6、9 构成一个等比数列的连续三项(公比为 $\frac{3}{2}$)。
|
||
|
||
我们称这样的数字 $n$ 为累进数。
|
||
|
||
一些累进数,如 9 和 10404 = ${102}^2$,同时也是完全平方数。 所有小于十万的累进平方数之和为 124657。
|
||
|
||
请求出所有小于一万亿(${10}^{12}$)累进平方数之和。
|
||
|
||
# --hints--
|
||
|
||
`progressivePerfectSquares()` 应该返回 `878454337159`。
|
||
|
||
```js
|
||
assert.strictEqual(progressivePerfectSquares(), 878454337159);
|
||
```
|
||
|
||
# --seed--
|
||
|
||
## --seed-contents--
|
||
|
||
```js
|
||
function progressivePerfectSquares() {
|
||
|
||
return true;
|
||
}
|
||
|
||
progressivePerfectSquares();
|
||
```
|
||
|
||
# --solutions--
|
||
|
||
```js
|
||
// solution required
|
||
```
|