2018-09-30 22:01:58 +00:00
|
|
|
---
|
|
|
|
id: 5900f52c1000cf542c51003f
|
|
|
|
challengeType: 5
|
|
|
|
title: 'Problem 448: Average least common multiple'
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
|
|
|
The function lcm(a,b) denotes the least common multiple of a and b.
|
|
|
|
Let A(n) be the average of the values of lcm(n,i) for 1≤i≤n.
|
2018-10-08 00:01:53 +00:00
|
|
|
E.g: A(2)=(2+2)/2=2 and A(10)=(10+10+30+20+10+30+70+40+90+10)/10=32.
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
Let S(n)=∑A(k) for 1≤k≤n.
|
|
|
|
S(100)=122726.
|
|
|
|
|
|
|
|
|
|
|
|
Find S(99999999019) mod 999999017.
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
<section id='instructions'>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
2018-10-04 13:37:37 +00:00
|
|
|
tests:
|
|
|
|
- text: <code>euler448()</code> should return 106467648.
|
2018-10-20 18:02:47 +00:00
|
|
|
testString: assert.strictEqual(euler448(), 106467648, '<code>euler448()</code> should return 106467648.');
|
2018-09-30 22:01:58 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
function euler448() {
|
|
|
|
// Good luck!
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler448();
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|
|
|
|
</section>
|