freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-343-fractional-sequ...

56 lines
1.2 KiB
Markdown
Raw Normal View History

---
id: 5900f4c41000cf542c50ffd6
challengeType: 5
title: 'Problem 343: Fractional Sequences'
videoUrl: ''
localeTitle: 问题343分数序列
---
## Description
<section id="description">对于任何正整数k分数xi / yi的有限序列ai由以下定义a1 = 1 / k且ai =xi-1 + 1/yi-1-1减少到最低项i&gt; 1 。当ai达到某个整数n时序列停止。 当yi = 1时。定义fk= n。例如对于k = 20 <p> 1/20→2/19→3/18 = 1/6→2/5→3/4→4/3→5/2→6/1 = 6 </p><p>所以f20= 6。 </p><p>对于1≤k≤100f1= 1f2= 2f3= 1且Σfk3= 118937。 </p><p>找Σfk3为1≤k≤2×106。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler343()</code>应该返回269533451410884200。
testString: 'assert.strictEqual(euler343(), 269533451410884200, "<code>euler343()</code> should return 269533451410884200.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler343() {
// Good luck!
return true;
}
euler343();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>