2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f4931000cf542c50ffa4
|
|
|
|
challengeType: 5
|
|
|
|
title: 'Problem 293: Pseudo-Fortunate Numbers'
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
|
|
|
An even positive integer N will be called admissible, if it is a power of 2 or its distinct prime factors are consecutive primes.
|
|
|
|
The first twelve admissible numbers are 2,4,6,8,12,16,18,24,30,32,36,48.
|
|
|
|
|
|
|
|
|
|
|
|
If N is admissible, the smallest integer M > 1 such that N+M is prime, will be called the pseudo-Fortunate number for N.
|
|
|
|
|
|
|
|
|
2018-10-08 00:01:53 +00:00
|
|
|
For example, N=630 is admissible since it is even and its distinct prime factors are the consecutive primes 2,3,5 and 7.
|
2018-09-30 22:01:58 +00:00
|
|
|
The next prime number after 631 is 641; hence, the pseudo-Fortunate number for 630 is M=11.
|
|
|
|
It can also be seen that the pseudo-Fortunate number for 16 is 3.
|
|
|
|
|
|
|
|
|
|
|
|
Find the sum of all distinct pseudo-Fortunate numbers for admissible numbers N less than 109.
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 13:37:37 +00:00
|
|
|
tests:
|
|
|
|
- text: <code>euler293()</code> should return 2209.
|
2018-10-20 18:02:47 +00:00
|
|
|
testString: assert.strictEqual(euler293(), 2209, '<code>euler293()</code> should return 2209.');
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
function euler293() {
|
|
|
|
// Good luck!
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler293();
|
|
|
|
```
|
|
|
|
|
|
|
|
</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>
|