freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-261-pivotal-square-...

1.2 KiB
Raw Blame History

id challengeType title videoUrl localeTitle
5900f4711000cf542c50ff84 5 Problem 261: Pivotal Square Sums 问题261Pivotal Square Sums

Description

如果存在一对m> 0且n≥k的整数则让我们称正整数ka square-pivot使得直到k的m + 1个连续正方形的总和等于m个连续正方形的总和从n + 1开始

km2 + ... + k2 =n + 12 + ... +n + m2。

一些小的方形枢轴是432 + 42 = 52 21202 + 212 = 292 24212 + 222 + 232 + 242 = 252 + 262 + 272 1101082 + 1092 + 1102 = 1332 + 1342找到所有的总和不同的方形枢轴≤1010。

Instructions

Tests

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

Challenge Seed

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

euler261();

Solution

// solution required