2018-09-30 22:01:58 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f5131000cf542c510024
|
|
|
|
|
challengeType: 5
|
|
|
|
|
title: 'Problem 421: Prime factors of n15+1'
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## Description
|
|
|
|
|
<section id='description'>
|
|
|
|
|
Numbers of the form n15+1 are composite for every integer n > 1.
|
|
|
|
|
For positive integers n and m let s(n,m) be defined as the sum of the distinct prime factors of n15+1 not exceeding m.
|
|
|
|
|
|
|
|
|
|
E.g. 215+1 = 3×3×11×331.
|
|
|
|
|
So s(2,10) = 3 and s(2,1000) = 3+11+331 = 345.
|
|
|
|
|
|
|
|
|
|
Also 1015+1 = 7×11×13×211×241×2161×9091.
|
|
|
|
|
So s(10,100) = 31 and s(10,1000) = 483.
|
|
|
|
|
Find ∑ s(n,108) for 1 ≤ n ≤ 1011.
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 13:37:37 +00:00
|
|
|
|
tests:
|
|
|
|
|
- text: <code>euler421()</code> should return 2304215802083466200.
|
2018-10-20 18:02:47 +00:00
|
|
|
|
testString: assert.strictEqual(euler421(), 2304215802083466200, '<code>euler421()</code> should return 2304215802083466200.');
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
function euler421() {
|
|
|
|
|
// Good luck!
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
euler421();
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|
|
|
|
|
</section>
|