# What is the last non-zero digit of $(\dots((2018\underset{! \text{ occurs }1009\text{ times}}{\underbrace{!)!)!\dots)!}}$?

Without using computer programs, can we find the last non-zero digit of

$$(\dots((2018\underset{! \text{ appears }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 $$!$$ appears $$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!

• have you tried smaller repeats ?
– user645636
Commented Aug 26, 2019 at 14:45
• smaller inputs @Gabe . With start value 3 I can get $((3!)!)!$ but the next gives me a truncation error in PARI/GP.
– user645636
Commented Aug 26, 2019 at 15:06
• Probably useful: math.stackexchange.com/questions/130352/… Commented Aug 26, 2019 at 15:18
• @Hussain-Alqatari would you tell me about the source of the problem? Commented Mar 24 at 8:12
• @Sbsty It can indicate how hard the problem is or which methods are needed to solve it. For example, it could appear in a computer science / algorithms textbook, or a number theory textbook, or an "open problems" section in a mathematical journal, or maybe OP's friend asked the problem and does not know how hard it is. Commented Mar 30 at 14:47