We call a positive integer $\textit{cheesy}$ if we can obtain the average of the digits in its decimal representation by putting a decimal separator after the leftmost digit. Prove that there are only finitely many $\textit{cheesy}$ numbers.
Problem
Source: MEMO 2022 T8
Tags: number theory
02.09.2022 17:13
By definition, $\overline{a_na_{n-1}\cdots a_1a_0}$ is cheesy if and only if $\frac{\overline{a_na_{n-1}\cdots a_1a_0}}{10^n} = \frac{a_0 + a_1 + \cdots + a_{n-1}+a_n}{n+1}$, i.e. $(n+1)\overline{a_na_{n-1}\cdots a_1a_0} = 10^n(a_0 + a_1 + \cdots + a_{n-1} + a_n)$. The main aim is to show that $n+1$ must be divisible by a large power of $2$ or $5$. So suppose $k \geq 0$ is such that $a_0 = a_1 = \cdots = a_{k-1} = 0 \neq a_{k}$ and hence $(n+1)\overline{a_na_{n-1}\cdots a_{k+1}a_k} = 10^{n-k}(a_k + \cdots + a_n)$. Since $a_k \neq 0$, the decimal number on the left is not divisible by either $2$ or $5$ and hence (since $2$ and $5$ are primes) any power of $2$ or any power of $5$ from the right-hand side must divide $n+1$. In particular, $n+1 \geq 2^{n-k}$. Now we bound $k$. The left hand side in the equation is at least $(n+1) \cdot a_n 10^{n-k}$ while the right hand side is at most $10^{n-k} \cdot (9(n-k) + a_n)$ and so $(n+1)a_n < 9(n-k) + a_n$, i.e. $n \leq na_n < 9(n-k)$, implying $k < \frac{8n}{9}$. Therefore $n+1 > 2^{n/9}$. On the other hand, induction on $n\geq 54$ shows $2^{n/9} > n+1$ (for $n=54$ clear and for the induction step just note $2^{1/9}(n+1) > n+2$ holds since $\left(1+\frac{1}{n+1}\right)^9 \leq \left(\frac{55}{54}\right)^9 < \left(\frac{11}{10}\right)^3 < 2$.
02.09.2022 20:32
Assassino9931 wrote: By definition, $\overline{a_na_{n-1}\cdots a_1a_0}$ is cheesy if and only if $\frac{\overline{a_na_{n-1}\cdots a_1a_0}}{10^n} = \frac{a_0 + a_1 + \cdots + a_{n-1}+a_n}{n+1}$, i.e. $(n+1)\overline{a_na_{n-1}\cdots a_1a_0} = 10^n(a_0 + a_1 + \cdots + a_{n-1} + a_n)$. The main aim is to show that $n+1$ must be divisible by a large power of $2$ or $5$. So suppose $k \geq 0$ is such that $a_0 = a_1 = \cdots = a_{k-1} = 0 \neq a_{k}$ and hence $(n+1)\overline{a_na_{n-1}\cdots a_{k+1}a_k} = 10^{n-k}(a_k + \cdots + a_n)$. Since $a_k \neq 0$, the decimal number on the left is not divisible by either $2$ or $5$ and hence (since $2$ and $5$ are primes) any power of $2$ or any power of $5$ from the right-hand side must divide $n+1$. In particular, $n+1 \geq 2^{n-k}$. Now we bound $k$. The left hand side in the equation is at least $(n+1) \cdot a_n 10^{n-k}$ while the right hand side is at most $10^{n-k} \cdot (9(n-k) + a_n)$ and so $(n+1)a_n < 9(n-k) + a_n$, i.e. $n \leq na_n < 9(n-k)$, implying $k < \frac{8n}{9}$. Therefore $n+1 > 2^{n/9}$. On the other hand, induction on $n\geq 54$ shows $2^{n/9} > n+1$ (for $n=54$ clear and for the induction step just note $2^{1/9}(n+1) > n+2$ holds since $\left(1+\frac{1}{n+1}\right)^9 \leq \left(\frac{55}{54}\right)^9 < \left(\frac{11}{10}\right)^3 < 2$. Cool solution! Only I think you should write "the decimal number on the left can't be divisible by both $2$ and $5$ at the same time" because the way you wrote it makes it look like the number can't be divisible by $2$ or $5$ at all which clearly isn't true for $a_k \in \{2,4,5,6,8\}$.
13.09.2022 01:43
A slightly different way to rephrase the solution: Let $n$ be the number of digits and $\frac{p}{q}$ be the average of the digits in lowest terms (i.e. $(p;q)=1$). Clearly, $q=2^a \cdot 5^b$ since otherwise the decimal expansion is infinite. In particular, $n \ge 2^a \cdot 5^b$ since $q \mid n$. On the other hand, any fraction with $q$ in the denominator has at most $\max(a,b)$ decimal digits after the comma different from $0$. Hence the sum of the digits is at most $9\max(a,b)+9$. On the other hand, it must be at least $n$ since the first digit is positive. Hence we get $9\max(a,b)+9 \ge 2^a \cdot 5^b \ge 2^{\max(a,b)}$ from where we easily get $\max(a,b) \le 6$ and hence $n \le 63$. So any cheesy number has at most $63$ digits, in particular there are only finitely many.
20.09.2022 12:29
Here is the complete list of cheesy numbers: $0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 45, 1500, 2250, 3750, 18000, 11250000, 1687500000000000$.