2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
id: 5900f4ed1000cf542c50ffff
|
|
|
|
title: 'Problem 383: Divisibility comparison between factorials'
|
2020-11-27 19:02:05 +01:00
|
|
|
challengeType: 5
|
2019-08-05 09:17:33 -07:00
|
|
|
forumTopicId: 302047
|
2021-01-13 03:31:00 +01:00
|
|
|
dashedName: problem-383-divisibility-comparison-between-factorials
|
2018-09-30 23:01:58 +01:00
|
|
|
---
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --description--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-30 16:59:29 +02:00
|
|
|
Let $f_5(n)$ be the largest integer $x$ for which $5^x$ divides $n$.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-30 16:59:29 +02:00
|
|
|
For example, $f_5(625\\,000) = 7$.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-30 16:59:29 +02:00
|
|
|
Let $T_5(n)$ be the number of integers $i$ which satisfy $f_5((2 \times i - 1)!) < 2 \times f_5(i!)$ and $1 ≤ i ≤ n$.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-30 16:59:29 +02:00
|
|
|
It can be verified that $T_5({10}^3) = 68$ and $T_5({10}^9) = 2\\,408\\,210$.
|
|
|
|
|
|
|
|
Find $T_5({10}^{18})$.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --hints--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2021-07-30 16:59:29 +02:00
|
|
|
`factorialDivisibilityComparison()` should return `22173624649806`.
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
```js
|
2021-07-30 16:59:29 +02:00
|
|
|
assert.strictEqual(factorialDivisibilityComparison(), 22173624649806);
|
2018-09-30 23:01:58 +01:00
|
|
|
```
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --seed--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
## --seed-contents--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
```js
|
2021-07-30 16:59:29 +02:00
|
|
|
function factorialDivisibilityComparison() {
|
2020-09-15 09:57:40 -07:00
|
|
|
|
2018-09-30 23:01:58 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-07-30 16:59:29 +02:00
|
|
|
factorialDivisibilityComparison();
|
2018-09-30 23:01:58 +01:00
|
|
|
```
|
|
|
|
|
2020-11-27 19:02:05 +01:00
|
|
|
# --solutions--
|
2018-09-30 23:01:58 +01:00
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|