2018-09-30 23:01:58 +01:00
|
|
|
|
---
|
|
|
|
|
id: 5900f51e1000cf542c510030
|
|
|
|
|
title: 'Problem 432: Totient sum'
|
2020-11-27 19:02:05 +01:00
|
|
|
|
challengeType: 5
|
2019-08-05 09:17:33 -07:00
|
|
|
|
forumTopicId: 302103
|
2021-01-13 03:31:00 +01:00
|
|
|
|
dashedName: problem-432-totient-sum
|
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 20:14:09 +02:00
|
|
|
|
Let $S(n, m) = \sum φ(n × i)$ for $1 ≤ i ≤ m$. ($φ$ is Euler's totient function)
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
2021-07-29 20:14:09 +02:00
|
|
|
|
You are given that $S(510\\,510, {10}^6) = 45\\,480\\,596\\,821\\,125\\,120$.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
2021-07-29 20:14:09 +02:00
|
|
|
|
Find $S(510\\,510, {10}^{11})$. Give the last 9 digits of your answer.
|
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 20:14:09 +02:00
|
|
|
|
`totientSum()` should return `754862080`.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
|
```js
|
2021-07-29 20:14:09 +02:00
|
|
|
|
assert.strictEqual(totientSum(), 754862080);
|
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 20:14:09 +02:00
|
|
|
|
function totientSum() {
|
2020-09-15 09:57:40 -07:00
|
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-29 20:14:09 +02:00
|
|
|
|
totientSum();
|
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
|
|
|
|
|
```
|