Removing factors to make the number ends with'2225' We have the integers 1, 2, ..., 50000.If we multiply them together, the last four digits will be '0000'. At least how many integers must be removed so that the product of the remaining integers ends with '2225'?
I know that if an integer ends with '2225', it's factors don't contain any '2', therefore at least 25000 integers need to be remove. Also, '2225' is divisible by 25 but not divisible by 125. Therefore, 5000−2=4998 multiples of 5 have to be removed. Thus, at least 25000+4998=29998 was cancelled out. However, how can I prove that the multiple of the remaining integers ends with '2225'(I can choose to reserve which multiples of 5), or there is any other integers to be removed? Thanks in advance.
 A: Suppose the product of the $20000$ with no $2$ or $5$ is $A$, and we choose $5B$ and $5C$.  We want to choose $B$ and $C$  so that $ABC=400D+89$.  Let $B=1$.
• Let $C_1$ be whatever digit makes $AC_1$ end in $9$.
• Let $C_2$ be whatever digit makes $A(C_1+10C_2)$ end in 89.
• Let $C_3$ be whichever of $1,2,3,4$ makes $AC=89\pmod{400}$.
A: If you strike out all $25000$ even numbers and all $5000$ odd multiples of $5$, the product of the remaining numbers will have a certain odd (=invertible) remainder $a\pmod {2^4}$ and a certain invertible remainder $b\pmod {5^4}$. We need to multiply one or more numbers back in to achieve a remainder of $2225\pmod {2^4}$ and $2225\pmod{5^4}$. To this end, we can use the Chinese Remainder Theorem to find a unique $x\in\{2,\ldots,1+2^45^2=401\}$ with $$x\equiv a^{-1}\frac{2225}{25}\pmod {2^4},\quad x\equiv b^{-1}\frac{2225}{25}\pmod{5^2}.$$
Obviously, $x$ will be odd and not divisible by $5$.
Then adding back the factor $25x$ will produce a product ending in $2225$ as desired. Alternatively, we can bring back two factors $5$ and $5x$ (note that $x\ne 1$). In summary, we have removed $25000+5000-2$ numbers (and less is not possible).
