Files
freeCodeCamp/curriculum/challenges/ukrainian/10-coding-interview-prep/project-euler/problem-448-average-least-common-multiple.md

49 lines
960 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: 5900f52c1000cf542c51003f
title: 'Завдання 448: Найменше спільне кратне'
challengeType: 5
forumTopicId: 302120
dashedName: problem-448-average-least-common-multiple
---
# --description--
Функція $lcm(a, b)$ позначає найменше спільне кратне $a$ і $b$.
Нехай $A(n)$ буде середнім зі значень $lcm(n, i)$ для $1 ≤ i ≤ n$.
Наприклад: $A(2) = \frac{2 + 2}{2} = 2$ та $A(10) = \frac{10 + 10 + 20 + 20 + 30 + 40 + 90 + 10}{10} = 32$.
Нехай $S(n) = \sum A(k)$ за $1 ≤ k n$.
$S(100) = 122\\,726$.
Знайдіть $S(99\\,999\\,999\\,019)\bmod 999\\,999\\,017$.
# --hints--
`averageLCM()` має повернути `106467648`.
```js
assert.strictEqual(averageLCM(), 106467648);
```
# --seed--
## --seed-contents--
```js
function averageLCM() {
return true;
}
averageLCM();
```
# --solutions--
```js
// solution required
```