freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-101-optimum-polynom...

56 lines
2.2 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: 5900f3d21000cf542c50fee4
challengeType: 5
title: 'Problem 101: Optimum polynomial'
videoUrl: ''
localeTitle: 问题101最佳多项式
---
## Description
<section id="description">如果我们被给出序列的前k个项则不可能肯定地说下一个项的值因为存在无限多个可以对序列建模的多项式函数。举个例子让我们考虑一下立方体数字的顺序。这由生成函数定义un = n31,8,27,64,125,216 ......假设我们只给出了该序列的前两个项。根据“简单就是最好”的原则我们应该假设一个线性关系并预测下一个项为15公共差异7。即使我们被提出前三个术语按照相同的简单原则也应假设二次关系。我们将OPkn定义为序列的前k个项的最佳多项式生成函数的第n项。应该清楚的是OPkn将准确地生成n≤k的序列项并且可能第一个不正确的项FIT将是OPkk + 1;在这种情况下我们将其称为坏OPBOP。作为一个基础如果我们只给出第一个序列项那么假设恒定是最明智的;也就是说对于n≥2OP1n= u1。因此我们获得了立方序列的以下OP <p> OP1n= 11 1,1,1,1 ...... OP2n= 7n-6 1,8,15...... OP3n= 6n2-11n + 6 1,8,27,58... OP4n= n3 1,8,27,64,125...... </p><p>显然对于k≥4不存在BOP。通过考虑BOP产生的FIT之和以红色表示我们得到1 + 15 + 58 = 74.考虑下面的十度多项式生成函数un = 1 - n + n2 - n3 + n4 - n5 + n6 - n7 + n8 - n9 + n10求BOP的FIT之和。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler101()</code>应该返回37076114526。
testString: 'assert.strictEqual(euler101(), 37076114526, "<code>euler101()</code> should return 37076114526.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler101() {
// Good luck!
return true;
}
euler101();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>