A positive integer $n$ is called cute when there is a positive integer $m$ such that $m!$ ends in exactly $n$ zeros. a) Determine if $2019$ is cute. b) How many positive integers less than $2019$ are cute?
Problem
Source: 1st Girls in Mathematics Tournament 2019 p4 (Brazil) / Torneio Meninas na Matematica (TM^2 )
Tags: factorial, number theory, combinatorics
22.10.2023 06:52
(1) Solution: Clearly, $v_2(m!)>v_5(m!)$, so it suffices to consider $v_5(m!)$. Let's list the values for the first few terms: $v_5(5!)=1, v_5(10!)=2, v_5(15!)=3, v_5(20!)=4, v_5(25!)=6$. There is no $m$ such that $v_5(m!)=5$, so $5$ is not a cute number. Analyzing further, when $25|m$, $v_5(m!)>v_5((m-1)!)+1$, and $v_5((m-1)!)+1$ is definitely not a cute number. Similarly, when $5^{k+1}|m$, $v_5(m!)>v_5((m-1)!)+k$, and $v_5((m-1)!)+1, v_5((m-1)!)+2, \ldots, v_5((m-1)!)+k$ are not cute numbers. Now consider $v_5(5^k!)$. Among the positive integers less than $5^k$, there is $1$ value of $x$ such that $v_5(x)=k$, $4$ values of $y$ such that $v_5(y)=k-1$, $4^2$ values of $z$ such that $v_5(z)=k-2$, and so on. Therefore, $v_5(5^k!)=1\cdot k+4\cdot (k-1)+4^2\cdot (k-2)+\ldots+4^{k-1}\cdot 1$. Hence, $v_5(5^2!)=6, v_5(5^3!)=29, v_5(5^4!)=112, v_5(5^5!)=453, v_5(5^6!)=1818$. This implies $v_5((5^6+5^4\cdot 3+5\cdot 2)!)=1818+112+29\cdot3+2=2019$. Therefore, $2019$ is a cute number. (2) From (1), we only need to consider $v_5((5^6+5^4\cdot 3+5\cdot 2)!)$. Among the positive integers less than $5^6+5^4\cdot 3+5\cdot 2$, there is $1$ value of $x$ such that $v_5(x)=6$, $4$ values of $y$ such that $v_5(y)=5$, $19$ values of $z$ such that $v_5(z)=4$, $76$ values of $w$ such that $v_5(w)=3$, and $304$ values of $u$ such that $v_5(u)=2$. Therefore, among positive integers less than $2019$, there are $5\cdot1+4\cdot4+3\cdot19+2\cdot76+1\cdot304=534$ non-cute numbers, and $2018-534=1484$ cute numbers.
25.10.2023 01:28
gnoka wrote: Therefore, $v_5(5^k!)=1\cdot k+4\cdot (k-1)+4^2\cdot (k-2)+\ldots+4^{k-1}\cdot 1$. Why $v_5(5^k!)=1\cdot k+4\cdot (k-1)+4^2\cdot (k-2)+\ldots+4^{k-1}\cdot 1$? For k= 3, we will have $v_5(125)= 31$, actually. 31, because: For $v_5(x)= 3$, we only have 1 (125) $\implies 1\cdot 3= 3$ For $v_5(x)= 2$, we have $\frac{125}{25}-\frac{125}{125}= 4\implies 4\cdot 2= 8$ For $v_5(x)= 1$, we have $\frac{125}{5}-\frac{125}{25}= 20\implies 20\cdot 1= 20$ So, $v_5(125)= 20+8+3= 31$.