freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-273-sum-of-squares....

1.1 KiB
Raw Blame History

id challengeType title videoUrl localeTitle
5900f47e1000cf542c50ff90 5 Problem 273: Sum of Squares 问题273正方形的总和

Description

考虑以下形式的方程a2 + b2 = N0≤a≤bab和N整数。

对于N = 65有两种解决方案a = 1b = 8a = 4b = 7。我们将SN称为a2 + b2 = N0≤a≤bab和N整数的所有解的a的值之和。因此S65= 1 + 4 = 5.找到ΣSN对于所有无平均N只能被4k + 1形式的素数整除其中4k + 1 <150。

Instructions

Tests

tests:
  - text: <code>euler273()</code>应该返回2032447591196869000。
    testString: 'assert.strictEqual(euler273(), 2032447591196869000, "<code>euler273()</code> should return 2032447591196869000.");'

Challenge Seed

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

euler273();

Solution

// solution required