* fix: clean-up Project Euler 141-160 * fix: corrections from review Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com> * fix: corrections from review Co-authored-by: Tom <20648924+moT01@users.noreply.github.com> * fix: use different notation for consistency * Update curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-144-investigating-multiple-reflections-of-a-laser-beam.md Co-authored-by: gikf <60067306+gikf@users.noreply.github.com> Co-authored-by: Sem Bauke <46919888+Sembauke@users.noreply.github.com> Co-authored-by: Tom <20648924+moT01@users.noreply.github.com>
49 lines
827 B
Markdown
49 lines
827 B
Markdown
---
|
|
id: 5900f40d1000cf542c50ff1f
|
|
title: 'Problem 160: Factorial trailing digits'
|
|
challengeType: 5
|
|
forumTopicId: 301794
|
|
dashedName: problem-160-factorial-trailing-digits
|
|
---
|
|
|
|
# --description--
|
|
|
|
For any $N$, let $f(N)$ be the last five digits before the trailing zeroes in $N!$.
|
|
|
|
For example,
|
|
|
|
$$\begin{align}
|
|
& 9! = 362880 \\; \text{so} \\; f(9) = 36288 \\\\
|
|
& 10! = 3628800 \\; \text{so} \\; f(10) = 36288 \\\\
|
|
& 20! = 2432902008176640000 \\; \text{so} \\; f(20) = 17664
|
|
\end{align}$$
|
|
|
|
Find $f(1,000,000,000,000)$
|
|
|
|
# --hints--
|
|
|
|
`factorialTrailingDigits()` should return `16576`.
|
|
|
|
```js
|
|
assert.strictEqual(factorialTrailingDigits(), 16576);
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --seed-contents--
|
|
|
|
```js
|
|
function factorialTrailingDigits() {
|
|
|
|
return true;
|
|
}
|
|
|
|
factorialTrailingDigits();
|
|
```
|
|
|
|
# --solutions--
|
|
|
|
```js
|
|
// solution required
|
|
```
|