2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f4c81000cf542c50ffdb
|
|
|
|
challengeType: 5
|
|
|
|
title: 'Problem 348: Sum of a square and a cube'
|
2019-08-05 16:17:33 +00:00
|
|
|
forumTopicId: 302007
|
2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
|
|
|
Many numbers can be expressed as the sum of a square and a cube. Some of them in more than one way.
|
|
|
|
|
|
|
|
Consider the palindromic numbers that can be expressed as the sum of a square and a cube, both greater than 1, in exactly 4 different ways.
|
|
|
|
For example, 5229225 is a palindromic number and it can be expressed in exactly 4 different ways:
|
|
|
|
22852 + 203
|
|
|
|
22232 + 663
|
|
|
|
18102 + 1253
|
|
|
|
11972 + 1563
|
|
|
|
|
|
|
|
Find the sum of the five smallest such palindromic numbers.
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 13:37:37 +00:00
|
|
|
tests:
|
|
|
|
- text: <code>euler348()</code> should return 1004195061.
|
2019-07-27 12:34:19 +00:00
|
|
|
testString: assert.strictEqual(euler348(), 1004195061);
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
function euler348() {
|
|
|
|
// Good luck!
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler348();
|
|
|
|
```
|
|
|
|
|
|
|
|
</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>
|