freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-402-integer-valued-...

1.2 KiB
Raw Blame History

id challengeType videoUrl localeTitle
5900f4ff1000cf542c510011 5 问题402整数值多项式

Description

可以证明对于每个整数n多项式n4 + 4n3 + 2n2 + 5n是6的倍数。还可以显示6是满足该属性的最大整数。

将Mabc定义为最大m使得n4 + an3 + bn2 + cn是所有整数n的m的倍数。例如M4,2,5= 6。

此外将SN定义为所有0 <abc≤N的Mabc之和。

我们可以验证S10= 1972和S10000= 2024258331114。

设Fk为斐波纳契数列对于k≥2F0 = 0F1 = 1且Fk = Fk-1 + Fk-2。

求最高9位数为ΣSFk为2≤k≤1234567890123。

Instructions

Tests

tests:
  - text: <code>euler402()</code>应返回356019862。
    testString: assert.strictEqual(euler402(), 356019862);

Challenge Seed

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

euler402();

Solution

// solution required

/section>