2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4181000cf542c50ff2a
|
2020-12-16 07:37:30 +00:00
|
|
|
|
title: 问题171:找到数字的平方和为正方形的数字
|
2018-10-10 22:03:03 +00:00
|
|
|
|
challengeType: 5
|
|
|
|
|
videoUrl: ''
|
|
|
|
|
---
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --description--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
对于正整数n,令f(n)为n的数字(在基数10中)的平方和,例如f(3)= 32 = 9,f(25)= 22 + 52 = 4 + 25 = 29,f(442)= 42 + 42 + 22 = 16 + 16 + 4 = 36找到所有n的总和的最后九位数,0 <n <1020,使得f(n)是一个完美的平方。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --hints--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
`euler171()`应该返回142989277。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
|
|
```js
|
2020-12-16 07:37:30 +00:00
|
|
|
|
assert.strictEqual(euler171(), 142989277);
|
2018-10-10 22:03:03 +00:00
|
|
|
|
```
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --solutions--
|
2020-08-13 15:24:35 +00:00
|
|
|
|
|