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.


Solution 1:

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