56 lines
1.8 KiB
Markdown
56 lines
1.8 KiB
Markdown
---
|
||
id: 5900f3ad1000cf542c50fec0
|
||
challengeType: 5
|
||
title: 'Problem 65: Convergents of e'
|
||
videoUrl: ''
|
||
localeTitle: 问题65:e的收敛
|
||
---
|
||
|
||
## Description
|
||
<section id="description"> 2的平方根可以写成无限连续分数。 <p> √2= 1 + 1 </p><p> 2 + 1 </p><p> 2 + 1 </p><p> 2 + 1 </p><p> 2 + ...... </p><p>可以写出无限连续分数,√2= [1;(2)],(2)表示2无限重复。以类似的方式,√23= [4;(1,3,1,8)]。事实证明,平方根的连续分数的部分值序列提供了最佳的有理近似。让我们考虑√2的收敛。 </p><p> 1 + 1 = 3/2 </p><p> 2 </p><p> 1 + 1 = 7/5 </p><p> 2 + 1 </p><p> 2 </p><p> 1 + 1 = 17/12 </p><p> 2 + 1 </p><p> 2 + 1 </p><p> 2 </p><p> 1 + 1 = 41/29 </p><p> 2 + 1 </p><p> 2 + 1 </p><p> 2 + 1 </p><p> 2 </p><p>因此,√2的前十个收敛的序列是:1,3 / 2,7 / 5,17 / 12,41 / 29,99 / 70,239 / 169,577 / 408,1333 / 985,3333 / 2378 ,...最令人惊讶的是重要的数学常数,e = [2; 1,2,1,1,4,1,1,6,1,......,1,2k,1,......]。 e的会聚序列中的前十个项是:2,3,8 / 3,11 / 4,19 / 7,87 / 32,106 / 39,193 / 71,1264 / 465,1457 / 536,.... ..第10个收敛的分子中的数字之和为1 + 4 + 5 + 7 = 17。求e的连续分数的第100个收敛的分子中的位数之和。 </p></section>
|
||
|
||
## Instructions
|
||
<section id="instructions">
|
||
</section>
|
||
|
||
## Tests
|
||
<section id='tests'>
|
||
|
||
```yml
|
||
tests:
|
||
- text: <code>euler65()</code>应该返回272。
|
||
testString: 'assert.strictEqual(euler65(), 272, "<code>euler65()</code> should return 272.");'
|
||
|
||
```
|
||
|
||
</section>
|
||
|
||
## Challenge Seed
|
||
<section id='challengeSeed'>
|
||
|
||
<div id='js-seed'>
|
||
|
||
```js
|
||
function euler65() {
|
||
// Good luck!
|
||
return true;
|
||
}
|
||
|
||
euler65();
|
||
|
||
```
|
||
|
||
</div>
|
||
|
||
|
||
|
||
</section>
|
||
|
||
## Solution
|
||
<section id='solution'>
|
||
|
||
```js
|
||
// solution required
|
||
```
|
||
</section>
|