71 lines
1.4 KiB
Markdown
71 lines
1.4 KiB
Markdown
---
|
|
id: 5900f3c51000cf542c50fed8
|
|
challengeType: 5
|
|
title: 'Problem 87: Prime power triples'
|
|
forumTopicId: 302201
|
|
---
|
|
|
|
## Description
|
|
<section id='description'>
|
|
|
|
The smallest number expressible as the sum of a prime square, prime cube, and prime fourth power is 28. In fact, there are exactly four numbers below fifty that can be expressed in such a way:
|
|
|
|
<div style='margin-left: 4em;'>
|
|
28 = 2<sup>2</sup> + 2<sup>3</sup> + 2<sup>4</sup><br>
|
|
33 = 3<sup>2</sup> + 2<sup>3</sup> + 2<sup>4</sup><br>
|
|
49 = 5<sup>2</sup> + 2<sup>3</sup> + 2<sup>4</sup><br>
|
|
47 = 2<sup>2</sup> + 3<sup>3</sup> + 2<sup>4</sup>
|
|
</div>
|
|
|
|
How many numbers below fifty million can be expressed as the sum of a prime square, prime cube, and prime fourth power?
|
|
|
|
</section>
|
|
|
|
## Instructions
|
|
<section id='instructions'>
|
|
|
|
</section>
|
|
|
|
## Tests
|
|
<section id='tests'>
|
|
|
|
```yml
|
|
tests:
|
|
- text: <code>primePowerTriples()</code> should return a number.
|
|
testString: assert(typeof primePowerTriples() === 'number');
|
|
- text: <code>primePowerTriples()</code> should return 1097343.
|
|
testString: assert.strictEqual(primePowerTriples(), 1097343);
|
|
|
|
```
|
|
|
|
</section>
|
|
|
|
## Challenge Seed
|
|
<section id='challengeSeed'>
|
|
|
|
<div id='js-seed'>
|
|
|
|
```js
|
|
function primePowerTriples() {
|
|
|
|
return true;
|
|
}
|
|
|
|
primePowerTriples();
|
|
```
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
## Solution
|
|
<section id='solution'>
|
|
|
|
```js
|
|
// solution required
|
|
```
|
|
|
|
</section>
|