First non-zero digit

491 Views Asked by At

In terms of n, which is the first non-zero digit of $\prod\limits_{i=1}^{n/2} (i)(n-i+1)$ for even n $\geq$ 6? Thank for any advice.

1

There are 1 best solutions below

0
On

Just a couple points of clarification... First, your product is just a rephrasing of the factorial of $n$. Second, by "first non-zero digit" I assume you mean "least significant" (or "rightmost", as people normally write numbers). Third, by "digit" I also assume you mean in the customary base ten.

That being said, your question is equivalent to finding the first non-zero digit of $n!$ in base ten. Let's call this $d(n)$. If we lived in a world with a number system base that was prime, then there is a not-too-crazy closed form expression for this. However, since our base ten is a product of two primes, the situation is slightly more complex. Nevertheless, there is a nice recurrence relation for $d(n)$, which is nicely described in this question: $$d(n)=\left\{ \begin{array}{ll} 4d(\lfloor n/5\rfloor)\cdot d(\text{units digit of }n), & \hbox{if the units digit of }n\hbox{ is odd;} \\ 6d(\lfloor n/5\rfloor)\cdot d(\text{units digit of }n), & \hbox{if the units digit of }n\hbox{ is even.} \end{array} \right.$$ If you wish, you can trace through this recursion to get an explicit formula.