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