freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-461-almost-pi.md

890 B
Raw Blame History

id title challengeType videoUrl dashedName
5900f53a1000cf542c51004c 问题461几乎是Pi 5 problem-461-almost-pi

--description--

对于所有非负整数k设fnk= ek / n-1。值得注意的是f2006+ f20075+ f20089+ f200226= 3.141592644529 ...≈π。事实上对于n = 200它是fna+ fnb+ fnc+ fnd形式的π的最佳近似值。设gn= a2 + b2 + c2 + d 2为abcd最小化错误| fna+ fnb+ fnc+ fnd - π| (其中| x |表示x的绝对值。给出g200= 62 + 752 + 892 + 2262 = 64658.求g10000

--hints--

euler461()应该返回159820276。

assert.strictEqual(euler461(), 159820276);

--seed--

--seed-contents--

function euler461() {

  return true;
}

euler461();

--solutions--

// solution required