Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-261-pivotal-square-sums.md
Oliver Eyton-Williams ee1e8abd87 feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

43 lines
907 B
Markdown

---
id: 5900f4711000cf542c50ff84
title: 'Problem 261: Pivotal Square Sums'
challengeType: 5
forumTopicId: 301910
dashedName: problem-261-pivotal-square-sums
---
# --description--
Let us call a positive integer k a square-pivot, if there is a pair of integers m > 0 and n ≥ k, such that the sum of the (m+1) consecutive squares up to k equals the sum of the m consecutive squares from (n+1) on:
(k-m)2 + ... + k2 = (n+1)2 + ... + (n+m)2.
Some small square-pivots are 4: 32 + 42 = 52 21: 202 + 212 = 292 24: 212 + 222 + 232 + 242 = 252 + 262 + 272 110: 1082 + 1092 + 1102 = 1332 + 1342Find the sum of all distinct square-pivots ≤ 1010.
# --hints--
`euler261()` should return 238890850232021.
```js
assert.strictEqual(euler261(), 238890850232021);
```
# --seed--
## --seed-contents--
```js
function euler261() {
return true;
}
euler261();
```
# --solutions--
```js
// solution required
```