freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-396-weak-goodstein-...

56 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 5900f4f81000cf542c51000b
challengeType: 5
videoUrl: ''
title: 问题396弱Goodstein序列
---
## Description
<section id="description">对于任何正整数n第n个弱Goodstein序列{g1g2g3...}定义为g1 = n对于k&gt; 1gk是通过在基k中写gk-1获得的将其解释为a基数k + 1减去1。 <p>当gk变为0时序列终止。 </p><p>例如第6个弱Goodstein序列是{6,11,17,25...}g1 = 6. g2 = 11因为6 = 1102,1103 = 1212 - 1 = 11. g3 = 17 11 = 1023,1024 = 18,18-1 = 17.g4 = 25因为17 = 1014,1015 = 26,26-1 = 25。 </p><p>等等。 </p><p>可以证明每个弱的Goodstein序列都会终止。 </p><p>设Gn为第n个弱Goodstein序列中的非零元素的数量。可以证实G2= 3G4= 21和G6= 381.还可以证实ΣGn= 25171≤n&lt;8。 </p><p>找到ΣGn的最后9位数1≤n&lt;16。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler396()</code>应该返回173214653。
testString: assert.strictEqual(euler396(), 173214653);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler396() {
// Good luck!
return true;
}
euler396();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
/section>