56 lines
1.1 KiB
Markdown
56 lines
1.1 KiB
Markdown
|
---
|
||
|
id: 5900f53a1000cf542c51004c
|
||
|
challengeType: 5
|
||
|
title: 'Problem 461: Almost Pi'
|
||
|
videoUrl: ''
|
||
|
localeTitle: 'Problema 461: Quase Pi'
|
||
|
---
|
||
|
|
||
|
## Description
|
||
|
<section id="description"> Seja fn (k) = ek / n - 1, para todos os inteiros não negativos k. Notavelmente, f200 (6) + f200 (75) + f200 (89) + f200 (226) = 3,141592644529… ≈ π. De fato, é a melhor aproximação de π da forma fn (a) + fn (b) + fn (c) + fn (d) para n = 200. Seja g (n) = a2 + b2 + c2 + d 2 para a, b, c, d que minimizam o erro: | fn (a) + fn (b) + fn (c) + fn (d) - π | (onde | x | denota o valor absoluto de x). Você recebe g (200) = 62 + 752 + 892 + 2262 = 64658. Encontre g (10000). </section>
|
||
|
|
||
|
## Instructions
|
||
|
<section id="instructions">
|
||
|
</section>
|
||
|
|
||
|
## Tests
|
||
|
<section id='tests'>
|
||
|
|
||
|
```yml
|
||
|
tests:
|
||
|
- text: ''
|
||
|
testString: 'assert.strictEqual(euler461(), 159820276, "<code>euler461()</code> should return 159820276.");'
|
||
|
|
||
|
```
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Challenge Seed
|
||
|
<section id='challengeSeed'>
|
||
|
|
||
|
<div id='js-seed'>
|
||
|
|
||
|
```js
|
||
|
function euler461() {
|
||
|
// Good luck!
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
euler461();
|
||
|
|
||
|
```
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Solution
|
||
|
<section id='solution'>
|
||
|
|
||
|
```js
|
||
|
// solution required
|
||
|
```
|
||
|
</section>
|