# The units digit of $1!+2!+3!+4!!+5!!+\dots+k\underset{\left \lfloor \sqrt{k} \right \rfloor \text{ times}}{\underbrace{!!!\dots!}}$

For natural numbers $$n\ge m$$, let $$n\underset{m \text{ times}}{\underbrace{!!!\dots!}}=n(n-m)(n-2m)(n-3m)\dots$$ where all factors are natural numbers (we exclude $$0$$ and negative factors).

Question:

What is the units digit of $$1!+2!+3!+4!!+5!!+\dots+k\underset{\left \lfloor \sqrt{k} \right \rfloor \text{ times}}{\underbrace{!!!\dots!}}+\dots+1992\underset{44 \text{ times}}{\underbrace{!!!\dots!}}$$? ($$\left \lfloor \cdot \right \rfloor$$ denotes the floor funtion).

My Attempt (Is wrong as Peter Foreman commented below):

Consider the first $$9$$ terms:

$$1!+2!+3!+4!!+5!!+6!!+7!!+8!!+9!!!$$

$$=1+2+6+8+15+48+105+384+162=731$$

Each of the remaining terms includes at least on factor that ends with $$0$$. Therefore, the each term ends with $$0$$.

Hence the units digit of the given expression is equal to the units digit of the sum of the first $$9$$ terms. So, $$1$$ is the units digit of the given expression.

Peter Foreman said: "$$17!!!!=9945$$". This showed me that my attempt is wrong. Thanks Peter Foreman.

Any help would be appreciated. THANKS.

• @PeterForeman ,, yeah , you are right that I am wrong. Aug 22 '19 at 8:25
• It's also going to be non-zero whenever the number of ! is a multiple of 5 and n isn't.
– user694818
Aug 22 '19 at 8:38
• @MatthewDaly Right. So can not we solve this problem by ordinary methods? Aug 22 '19 at 8:42
• I'd write a program that spits out the first hundred unit digits and stare at it for a while. The pattern will be easier to prove when you know what it is.
– user694818
Aug 22 '19 at 8:51
• It's $1$. (I don't know how to prove it without computation) Aug 22 '19 at 9:58

When $$k \geq 25$$ and the floor part $$p$$ of $$k^{0.5}$$ is coprime with $$10$$, the unit digit of $$k’=k! \ldots !$$ is $$0$$ (there is an even number in $$k,k-p$$ and one divisible by $$5$$ in $$k!!!!!$$).

When $$k \geq 25$$ and $$p \wedge 10=2$$, there is going to be a number divisible by $$5$$ in $$k,k-p,k-2p,k-3p,k-4p$$, and $$k’$$ is divisible by $$5$$ and congruent to $$k$$ mod $$2$$, so the unit digit of $$k’$$ is $$5$$ if $$k$$ is odd and $$0$$ if $$k$$ is even.

When $$k \geq 25$$ and $$p \wedge 10=5$$, then $$k(k-p)$$ is even, so $$k’$$ is even. The congruence mod $$5$$ is trickier: $$k’$$ is congruent to $$k^r$$ mod $$5$$, where $$r$$ is the number of factors in he product (ie $$r-1$$ is the floor part of $$(k-1)/p$$, so $$r$$ is either $$p$$, $$p+1$$ or $$p+2$$).

When $$10 | p$$, as above, $$k’$$ is congruent to $$k^r$$ mod $$10$$.

Note that everything depends only on the unit digit of $$k$$, $$p$$ and $$r$$: when $$p$$ is set, and $$p \wedge 10=2$$, the sum of any four $$k’$$ corresponding to consecutive $$k \geq 25$$ vanishes mod $$10$$.

When $$p,r$$ are set and $$p \wedge 10=5$$, the sum of any five $$k’$$ corresponding to consecutive $$k \geq 25$$ is always divisible by $$10$$.

When $$p,r$$ are set and $$p \wedge 10=10$$, the sum of any ten $$k’$$ corresponding to consecutive $$k \geq 100$$ is congruent to $$3$$ mod $$10$$ if $$4|r$$ and $$5$$ mod $$10$$ otherwise.

So all we need now is time for processing all integers from $$1$$ to $$1992$$.

• Why the downvotes? Aug 22 '19 at 9:33
• Can you please clarify what do you mean by the notations $k'$, $p \wedge 10=10$,...? Thank you very much. Aug 24 '19 at 10:52
• $\wedge$ is the gcd. $p$ is the floor part of $\sqrt{k}$. $r-1$ is the floor part of $(k-1)/p$. $k’=k(k-p)(k-2p)\ldots(k-(r-1)p)$. Aug 24 '19 at 11:08
• So this problem is not solvable unless we find the units digit of all $1992$ terms, right? Is not there any method to solve it? Aug 24 '19 at 11:19
• The answer outlines many possible shortcuts, but why would you expect there to be an instant solution without any calculation? Aug 24 '19 at 13:34