2018-10-10 18:03:03 -04:00
---
id: 5900f4521000cf542c50ff64
2021-02-06 04:42:36 +00:00
title: 'Problem 229: Four Representations using Squares'
2018-10-10 18:03:03 -04:00
challengeType: 5
2021-02-06 04:42:36 +00:00
forumTopicId: 301872
2021-01-13 03:31:00 +01:00
dashedName: problem-229-four-representations-using-squares
2018-10-10 18:03:03 -04:00
---
2020-12-16 00:37:30 -07:00
# --description--
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
Consider the number 3600. It is very special, because
2018-10-10 18:03:03 -04:00
2020-12-16 00:37:30 -07:00
3600 = 482 + 362 3600 = 202 + 2× 402 3600 = 302 + 3× 302 3600 = 452 + 7× 152
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
Similarly, we find that 88201 = 992 + 2802 = 2872 + 2× 542 = 2832 + 3× 522 = 1972 + 7× 842.
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
In 1747, Euler proved which numbers are representable as a sum of two squares. We are interested in the numbers n which admit representations of all of the following four types:
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
n = a12 + b12n = a22 + 2 b22n = a32 + 3 b32n = a72 + 7 b72,
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
where the ak and bk are positive integers.
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
There are 75373 such numbers that do not exceed 107.
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
How many such numbers are there that do not exceed 2× 109?
2018-10-10 18:03:03 -04:00
2020-12-16 00:37:30 -07:00
# --hints--
2018-10-10 18:03:03 -04:00
2021-02-06 04:42:36 +00:00
`euler229()` should return 11325263.
2018-10-10 18:03:03 -04:00
```js
2020-12-16 00:37:30 -07:00
assert.strictEqual(euler229(), 11325263);
2018-10-10 18:03:03 -04:00
```
2020-08-13 17:24:35 +02:00
2021-01-13 03:31:00 +01:00
# --seed--
## --seed-contents--
```js
function euler229() {
return true;
}
euler229();
```
2020-12-16 00:37:30 -07:00
# --solutions--
2021-01-13 03:31:00 +01:00
```js
// solution required
```