12
$\begingroup$

Without using computer programs, can we find the last non-zero digit of $(\dots((2018\underset{! \text{ occurs }1009\text{ times}}{\underbrace{!)!)!\dots)!}}$?

What I know is that the last non-zero digit of $2018!$ is $4$, but I do not know what to do with that $4$.

Is it useful that $!$ occurs $1009$ times where $1009$ is half of $2018$? If that is useful, then what if $1009$ was another value, say $1234$?

Any help will be appreciated. THANKS!

$\endgroup$
5
  • 1
    $\begingroup$ have you tried smaller repeats ? $\endgroup$
    – user645636
    Aug 26, 2019 at 14:45
  • $\begingroup$ @Roddy MacPhee Even doing two factorials is an obscenely large number, a quick wolframalpha search shows $(2018!)! > 10^{10^{5000}}$ $\endgroup$
    – Gabe
    Aug 26, 2019 at 15:00
  • 1
    $\begingroup$ smaller inputs @Gabe . With start value 3 I can get $((3!)!)!$ but the next gives me a truncation error in PARI/GP. $\endgroup$
    – user645636
    Aug 26, 2019 at 15:06
  • 3
    $\begingroup$ Probably useful: math.stackexchange.com/questions/130352/… $\endgroup$ Aug 26, 2019 at 15:18
  • $\begingroup$ or that $10^n!$ has the same last non-zero digit of $(9!)^{10^n-1\over 9}$ $\endgroup$
    – user645636
    Aug 26, 2019 at 15:38

1 Answer 1

11
$\begingroup$

First, note the following: Let $N$ be an multiple of 10 i.e., $N=10k$. Then the last nonzero digit of $N!$ is

a) $3 \cdot 4 \cdot 6 \cdot 7 \cdot 8 \cdot 9 \equiv _{10} $ 8 if $k \equiv_4 1$;

b) $8^2$ mod 10 which is 4 if $k \equiv_4 2$;

c) $8^3$ mod 10 which is 2 if $k \equiv_4 3$; and

d) $8^4$ mod 10 which is 6 if $k \equiv_4 0$.

Clearly $(\ldots ((2018!)!)! \ldots ) !$ is of the form $10k$; $k$ a multiple of 4. So the last nonzero digit is 6.

$\endgroup$
6
  • $\begingroup$ I just ediited @RossMillikan . There was a typo $\endgroup$
    – Mike
    Aug 26, 2019 at 17:44
  • $\begingroup$ If $N$ is of the form $10k$; $k \equiv_4 2$ then the last nonzerto digit is $8^2 \mod_{10}=4$, as I already have down. $\endgroup$
    – Mike
    Aug 26, 2019 at 17:47
  • $\begingroup$ @RossMillikan I did edit to add clarification $\endgroup$
    – Mike
    Aug 26, 2019 at 17:49
  • $\begingroup$ Can you please tell how do you know that $4|k$? $\endgroup$ Aug 27, 2019 at 5:45
  • 1
    $\begingroup$ If $M$ is an integer at least 40 (which 2018 is of course) then $M!$ is a multiple of 40. So $(2018)!$ is a multiple of 40, as is $((2018)!)!$ (as $2018!$ is clearly at least 40), as is $((2018!)!)!$, and so on and so forth. $\endgroup$
    – Mike
    Aug 27, 2019 at 18:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .