2018-09-30 22:01:58 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4521000cf542c50ff64
|
|
|
|
|
challengeType: 5
|
|
|
|
|
title: 'Problem 229: Four Representations using Squares'
|
2019-08-05 16:17:33 +00:00
|
|
|
|
forumTopicId: 301872
|
2018-09-30 22:01:58 +00:00
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
<section id='description'>
|
|
|
|
|
Consider the number 3600. It is very special, because
|
|
|
|
|
|
|
|
|
|
3600 = 482 + 362
|
|
|
|
|
3600 = 202 + 2×402
|
|
|
|
|
3600 = 302 + 3×302
|
|
|
|
|
3600 = 452 + 7×152
|
|
|
|
|
|
|
|
|
|
Similarly, we find that 88201 = 992 + 2802 = 2872 + 2×542 = 2832 + 3×522 = 1972 + 7×842.
|
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
|
|
n = a12 + b12n = a22 + 2 b22n = a32 + 3 b32n = a72 + 7 b72,
|
|
|
|
|
|
|
|
|
|
where the ak and bk are positive integers.
|
|
|
|
|
|
|
|
|
|
There are 75373 such numbers that do not exceed 107.
|
|
|
|
|
|
|
|
|
|
How many such numbers are there that do not exceed 2×109?
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 13:37:37 +00:00
|
|
|
|
tests:
|
|
|
|
|
- text: <code>euler229()</code> should return 11325263.
|
2019-07-27 02:26:37 +00:00
|
|
|
|
testString: assert.strictEqual(euler229(), 11325263);
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler229() {
|
|
|
|
|
// Good luck!
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler229();
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|
2019-07-18 15:24:12 +00:00
|
|
|
|
|
2018-09-30 22:01:58 +00:00
|
|
|
|
</section>
|