2018-09-30 23:01:58 +01:00
---
id: 5900f4d01000cf542c50ffe2
title: 'Problem 355: Maximal coprime subset'
2020-11-27 19:02:05 +01:00
challengeType: 5
2019-08-05 09:17:33 -07:00
forumTopicId: 302015
2021-01-13 03:31:00 +01:00
dashedName: problem-355-maximal-coprime-subset
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
Define $Co(n)$ to be the maximal possible sum of a set of mutually co-prime elements from $\\{1, 2, \ldots, n\\}$. For example $Co(10)$ is 30 and hits that maximum on the subset $\\{1, 5, 7, 8, 9\\}$.
2018-09-30 23:01:58 +01:00
2021-07-29 19:14:22 +02:00
You are given that $Co(30) = 193$ and $Co(100) = 1356$.
2018-09-30 23:01:58 +01:00
2021-07-29 19:14:22 +02:00
Find $Co(200\\,000)$.
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
`maximalCoprimeSubset()` should return `1726545007` .
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(maximalCoprimeSubset(), 1726545007);
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 maximalCoprimeSubset() {
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
maximalCoprimeSubset();
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
```