2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
id: 5900f4d11000cf542c50ffe4
|
|
|
|
title: 'Problem 357: Prime generating integers'
|
2020-11-27 19:02:05 +01:00
|
|
|
challengeType: 5
|
2019-08-05 09:17:33 -07:00
|
|
|
forumTopicId: 302017
|
2021-01-13 03:31:00 +01:00
|
|
|
dashedName: problem-357-prime-generating-integers
|
2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --description--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-29 19:14:22 +02:00
|
|
|
Consider the divisors of 30: 1, 2, 3, 5, 6, 10, 15, 30.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-29 19:14:22 +02:00
|
|
|
It can be seen that for every divisor $d$ of 30, $d + \frac{30}{d}$ is prime.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-29 19:14:22 +02:00
|
|
|
Find the sum of all positive integers $n$ not exceeding $100\\,000\\,000$ such that for every divisor $d$ of $n$, $d + \frac{n}{d}$ is prime.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --hints--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-29 19:14:22 +02:00
|
|
|
`primeGeneratingIntegers()` should return `1739023853137`.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
```js
|
2021-07-29 19:14:22 +02:00
|
|
|
assert.strictEqual(primeGeneratingIntegers(), 1739023853137);
|
2018-09-30 23:01:58 +01:00
|
|
|
```
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --seed--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
## --seed-contents--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
```js
|
2021-07-29 19:14:22 +02:00
|
|
|
function primeGeneratingIntegers() {
|
2020-09-15 09:57:40 -07:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-07-29 19:14:22 +02:00
|
|
|
primeGeneratingIntegers();
|
2018-09-30 23:01:58 +01:00
|
|
|
```
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --solutions--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|