56 lines
1.1 KiB
Markdown
56 lines
1.1 KiB
Markdown
---
|
||
id: 5900f3c81000cf542c50fedb
|
||
challengeType: 5
|
||
title: 'Problem 92: Square digit chains'
|
||
videoUrl: ''
|
||
localeTitle: 问题92:方形数字链
|
||
---
|
||
|
||
## Description
|
||
<section id="description">通过在数字中连续添加数字的平方来创建数字链,以形成新的数字,直到之前看到它为止。例如,44→32→13→10→1→1 85→89→145→42→20→4→16→37→58→89因此,任何到达1或89的链条都会卡在无限循环中。最令人惊讶的是,每个起始号码最终都会达到1或89.低于一千万的起始号码将达到89个? </section>
|
||
|
||
## Instructions
|
||
<section id="instructions">
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: <code>euler92()</code>应返回8581146。
|
||
testString: 'assert.strictEqual(euler92(), 8581146, "<code>euler92()</code> should return 8581146.");'
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
function euler92() {
|
||
// Good luck!
|
||
return true;
|
||
}
|
||
|
||
euler92();
|
||
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
</section>
|