Back to Freecodecamp

Problem 383: Divisibility comparison between factorials

curriculum/challenges/english/blocks/project-euler-problems-301-to-400/5900f4ed1000cf542c50ffff.md

latest709 B
Original Source

--description--

Let $f_5(n)$ be the largest integer $x$ for which $5^x$ divides $n$.

For example, $f_5(625\,000) = 7$.

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$.

It can be verified that $T_5({10}^3) = 68$ and $T_5({10}^9) = 2\,408\,210$.

Find $T_5({10}^{18})$.

--hints--

factorialDivisibilityComparison() should return 22173624649806.

js
assert.strictEqual(factorialDivisibilityComparison(), 22173624649806);

--seed--

--seed-contents--

js
function factorialDivisibilityComparison() {

  return true;
}

factorialDivisibilityComparison();

--solutions--

js
// solution required