Computing the last non-zero digit of ${1027 \choose 41}$?

557 Views Asked by At

I am working on the following problem:

Let $x_n$ be a sequence of positive odd numbers. If $N$ is the number of ordered pairs $(x_1, x_2, x_3, \dots, x_{42})$ such that $$x_1 + x_2 + x_3 + \dots + x_{42} = 2014,$$

then find $N \pmod {1000}$

My progress: Let $x_n = 2a_n + 1$, with $a_n \geq 0$. Then $$a_1 + a_2 + a_3 + \dots + a_{42} = 986$$

By stars and bars, this equals ${1027 \choose 41}$.

To find what this is equal to $\pmod {1000}$, I first computed the number of $5$s in it. I found that there were $2$ more $5$s in the numerator, and I am sure there are at least $2$ more $2$s in the numerator as well (the top has $2^{10} = 1024$), so there are two ending zeros. However, I do not know how I might find the last non-zero digit of this number.