2021-06-15 00:49:18 -07:00
|
|
|
---
|
|
|
|
id: 5900f4ae1000cf542c50ffbf
|
2021-11-19 10:31:54 -08:00
|
|
|
title: 'Problema 320: Fatoriais divisíveis por um número inteiro muito grande'
|
2021-06-15 00:49:18 -07:00
|
|
|
challengeType: 5
|
|
|
|
forumTopicId: 301977
|
|
|
|
dashedName: problem-320-factorials-divisible-by-a-huge-integer
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
2021-11-19 10:31:54 -08:00
|
|
|
Considere $N(i)$ como o menor número inteiro $n$, tal que $n!$ é divisível por $(i!)^{1234567890}$
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2021-11-19 10:31:54 -08:00
|
|
|
Considere $S(u) = \sum N(i)$ para $10 ≤ i ≤ u$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2021-11-19 10:31:54 -08:00
|
|
|
$S(1000)=614.538.266.565.663$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2021-11-19 10:31:54 -08:00
|
|
|
Encontre $S(1.000.000)\bmod {10}^{18}$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
2021-11-19 10:31:54 -08:00
|
|
|
`divisibleByHugeInteger()` deve retornar `278157919195482660`.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
```js
|
2021-11-19 10:31:54 -08:00
|
|
|
assert.strictEqual(divisibleByHugeInteger(), 278157919195482660);
|
2021-06-15 00:49:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
2021-11-19 10:31:54 -08:00
|
|
|
function divisibleByHugeInteger() {
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-11-19 10:31:54 -08:00
|
|
|
divisibleByHugeInteger();
|
2021-06-15 00:49:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|