2018-09-30 22:01:58 +00:00
---
id: 5900f4711000cf542c50ff84
title: 'Problem 261: Pivotal Square Sums'
2020-11-27 18:02:05 +00:00
challengeType: 5
2019-08-05 16:17:33 +00:00
forumTopicId: 301910
2021-01-13 02:31:00 +00:00
dashedName: problem-261-pivotal-square-sums
2018-09-30 22:01:58 +00:00
---
2020-11-27 18:02:05 +00:00
# --description--
2021-07-24 07:09:54 +00:00
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:
2018-09-30 22:01:58 +00:00
2021-07-24 07:09:54 +00:00
$${(k - m)}^2 + \ldots + k^2 = {(n + 1)}^2 + \ldots + {(n + m)}^2$$
2018-09-30 22:01:58 +00:00
2021-07-24 07:09:54 +00:00
Some small square-pivots are
$$\begin{align}
& \mathbf{4}: 3^2 + \mathbf{4}^2 = 5^2 \\\\
& \mathbf{21}: {20}^2 + \mathbf{21}^2 = {29}^2 \\\\
& \mathbf{24}: {21}^2 + {22}^2 + {23}^2 + \mathbf{24}^2 = {25}^2 + {26}^2 + {27}^2 \\\\
& \mathbf{110}: {108}^2 + {109}^2 + \mathbf{110}^2 = {133}^2 + {134}^2 \\\\
\end{align}$$
Find the sum of all distinct square-pivots $≤ {10}^{10}$.
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
# --hints--
2018-09-30 22:01:58 +00:00
2021-07-24 07:09:54 +00:00
`pivotalSquareSums()` should return `238890850232021` .
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
```js
2021-07-24 07:09:54 +00:00
assert.strictEqual(pivotalSquareSums(), 238890850232021);
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --seed--
2018-09-30 22:01:58 +00:00
2020-11-27 18:02:05 +00:00
## --seed-contents--
2018-09-30 22:01:58 +00:00
```js
2021-07-24 07:09:54 +00:00
function pivotalSquareSums() {
2020-09-15 16:57:40 +00:00
2018-09-30 22:01:58 +00:00
return true;
}
2021-07-24 07:09:54 +00:00
pivotalSquareSums();
2018-09-30 22:01:58 +00:00
```
2020-11-27 18:02:05 +00:00
# --solutions--
2018-09-30 22:01:58 +00:00
```js
// solution required
```