2018-10-10 18:03:03 -04:00
|
|
|
---
|
|
|
|
id: 5900f4ae1000cf542c50ffbf
|
2021-02-06 04:42:36 +00:00
|
|
|
title: 'Problem 320: Factorials divisible by a huge integer'
|
2018-10-10 18:03:03 -04:00
|
|
|
challengeType: 5
|
2021-02-06 04:42:36 +00:00
|
|
|
forumTopicId: 301977
|
2021-01-13 03:31:00 +01:00
|
|
|
dashedName: problem-320-factorials-divisible-by-a-huge-integer
|
2018-10-10 18:03:03 -04:00
|
|
|
---
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --description--
|
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
Let N(i) be the smallest integer n such that n! is divisible by (i!)1234567890
|
2020-02-18 01:40:55 +09:00
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
Let S(u)=∑N(i) for 10 ≤ i ≤ u.
|
2020-02-18 01:40:55 +09:00
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
S(1000)=614538266565663.
|
2020-02-18 01:40:55 +09:00
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
Find S(1 000 000) mod 1018.
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --hints--
|
2018-10-10 18:03:03 -04:00
|
|
|
|
2021-02-06 04:42:36 +00:00
|
|
|
`euler320()` should return 278157919195482660.
|
2018-10-10 18:03:03 -04:00
|
|
|
|
|
|
|
```js
|
2020-12-16 00:37:30 -07:00
|
|
|
assert.strictEqual(euler320(), 278157919195482660);
|
2018-10-10 18:03:03 -04:00
|
|
|
```
|
|
|
|
|
2021-01-13 03:31:00 +01:00
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
|
|
|
function euler320() {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
euler320();
|
|
|
|
```
|
|
|
|
|
2020-12-16 00:37:30 -07:00
|
|
|
# --solutions--
|
2020-08-13 17:24:35 +02:00
|
|
|
|
2021-01-13 03:31:00 +01:00
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|