2018-09-30 23:01:58 +01:00
---
id: 5900f4571000cf542c50ff69
title: 'Problem 234: Semidivisible numbers'
2020-11-27 19:02:05 +01:00
challengeType: 5
2019-08-05 09:17:33 -07:00
forumTopicId: 301878
2021-01-13 03:31:00 +01:00
dashedName: problem-234-semidivisible-numbers
2018-09-30 23:01:58 +01:00
---
2020-11-27 19:02:05 +01:00
# --description--
2021-07-15 14:26:34 +02:00
For an integer $n ≥ 4$, we define the lower prime square root of $n$, denoted by $lps(n)$, as the $\text{largest prime} ≤ \sqrt{n}$ and the upper prime square root of $n$, $ups(n)$, as the $\text{smallest prime} ≥ \sqrt{n}$.
2020-11-27 19:02:05 +01:00
2021-07-15 14:26:34 +02:00
So, for example, $lps(4) = 2 = ups(4)$, $lps(1000) = 31$, $ups(1000) = 37$.
2020-11-27 19:02:05 +01:00
2021-07-15 14:26:34 +02:00
Let us call an integer $n ≥ 4$ semidivisible, if one of $lps(n)$ and $ups(n)$ divides $n$, but not both.
2018-09-30 23:01:58 +01:00
2021-07-15 14:26:34 +02:00
The sum of the semidivisible numbers not exceeding 15 is 30, the numbers are 8, 10 and 12. 15 is not semidivisible because it is a multiple of both $lps(15) = 3$ and $ups(15) = 5$. As a further example, the sum of the 92 semidivisible numbers up to 1000 is 34825.
2018-09-30 23:01:58 +01:00
2021-07-15 14:26:34 +02:00
What is the sum of all semidivisible numbers not exceeding 999966663333?
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-15 14:26:34 +02:00
`semidivisibleNumbers()` should return `1259187438574927000` .
2018-09-30 23:01:58 +01:00
2020-11-27 19:02:05 +01:00
```js
2021-07-15 14:26:34 +02:00
assert.strictEqual(semidivisibleNumbers(), 1259187438574927000);
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-15 14:26:34 +02:00
function semidivisibleNumbers() {
2020-09-15 09:57:40 -07:00
2018-09-30 23:01:58 +01:00
return true;
}
2021-07-15 14:26:34 +02:00
semidivisibleNumbers();
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
```