2021-06-15 00:49:18 -07:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4da1000cf542c50ffec
|
2021-11-23 11:06:14 -08:00
|
|
|
|
title: 'Problema 365: Um coeficiente binomial enorme'
|
2021-06-15 00:49:18 -07:00
|
|
|
|
challengeType: 5
|
|
|
|
|
forumTopicId: 302026
|
|
|
|
|
dashedName: problem-365-a-huge-binomial-coefficient
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
2021-11-23 11:06:14 -08:00
|
|
|
|
O coeficiente binomial $\displaystyle\binom{{10}^{18}}{{10}^9}$ é um número com mais de 9 bilhões de algarismos ($9 × {10}^9$).
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
2021-11-23 11:06:14 -08:00
|
|
|
|
Considere $M(n, k, m)$ como o coeficiente binomial $\displaystyle\binom{n}{k}$ modulo $m$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
2021-11-23 11:06:14 -08:00
|
|
|
|
Calcule $\sum M({10}^{18}, {10}^9, p \times q \times r)$ para$1000 < p < q < r < 5000$ e com $p$, $q$, $r$ sendo números primos.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
|
2021-11-23 11:06:14 -08:00
|
|
|
|
`hugeBinomialCoefficient()` deve retornar `162619462356610300`.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
|
|
```js
|
2021-11-23 11:06:14 -08:00
|
|
|
|
assert.strictEqual(hugeBinomialCoefficient(), 162619462356610300);
|
2021-06-15 00:49:18 -07:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
|
|
```js
|
2021-11-23 11:06:14 -08:00
|
|
|
|
function hugeBinomialCoefficient() {
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-23 11:06:14 -08:00
|
|
|
|
hugeBinomialCoefficient();
|
2021-06-15 00:49:18 -07:00
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
|
// solution required
|
|
|
|
|
```
|