2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f47e1000cf542c50ff90
|
|
|
|
challengeType: 5
|
|
|
|
title: 'Problem 273: Sum of Squares'
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
|
|
|
Consider equations of the form: a2 + b2 = N, 0 ≤ a ≤ b, a, b and N integer.
|
|
|
|
|
|
|
|
For N=65 there are two solutions:
|
|
|
|
a=1, b=8 and a=4, b=7.
|
|
|
|
We call S(N) the sum of the values of a of all solutions of a2 + b2 = N, 0 ≤ a ≤ b, a, b and N integer.
|
|
|
|
Thus S(65) = 1 + 4 = 5.
|
|
|
|
Find ∑S(N), for all squarefree N only divisible by primes of the form 4k+1 with 4k+1 < 150.
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 13:37:37 +00:00
|
|
|
tests:
|
|
|
|
- text: <code>euler273()</code> should return 2032447591196869000.
|
2018-10-20 18:02:47 +00:00
|
|
|
testString: assert.strictEqual(euler273(), 2032447591196869000, '<code>euler273()</code> should return 2032447591196869000.');
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
function euler273() {
|
|
|
|
// Good luck!
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler273();
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|
|
|
|
</section>
|