freeCodeCamp/curriculum/challenges/spanish/08-coding-interview-prep/project-euler/problem-461-almost-pi.spani...

1.2 KiB

id localeTitle challengeType title
5 5900f53a1000cf542c51004c 5 Problem 461: Almost Pi

Description

Sea fn (k) = ek / n - 1, para todos los enteros no negativos k. Notablemente, f200 (6) + f200 (75) + f200 (89) + f200 (226) = 3.141592644529… ≈ π. De hecho, es la mejor aproximación de π de la forma fn (a) + fn (b) + fn (c) + fn (d) para n = 200. Sea g (n) = a2 + b2 + c2 + d 2 para a, b, c, d que minimizan el error: | fn (a) + fn (b) + fn (c) + fn (d) - π | (donde | x | denota el valor absoluto de x). Le dan g (200) = 62 + 752 + 892 + 2262 = 64658. Encuentre g (10000).

Instructions

Tests

tests:
  - text: <code>euler461()</code> debe devolver 159820276.
    testString: 'assert.strictEqual(euler461(), 159820276, "<code>euler461()</code> should return 159820276.");'

Challenge Seed

function euler461() {
  // Good luck!
  return true;
}

euler461();

Solution

// solution required