56 lines
1.6 KiB
Markdown
56 lines
1.6 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>
|