A Problem from the Australian Math Olympiad

Let \(S(n)\) be the product of the digits of \(n\in\mathbb{N}\). Find all natural numbers \(n\) such that \(S(n)=n^2-17n+56\).
*Hint: try to first prove that \(n\geq S(n)\).

Lemma: For all \(n\in\mathbb{N}\), we have that \(n\geq S(n)\).
Let \(n=\overline{x_kx_{k-1}\ldots x_1x_0}=x_k\cdot 10^k+x_{k-1}\cdot 10^{k-1}\ldots+x_1\cdot 10+x_0\). Then we have that $$S(n)=x_kx_{k-1}\cdots x_1x_0=\prod_{i=0}^{k}x_i.$$ Since each \(x_i\in\{0,1,\ldots,9\}\Rightarrow x_i\leq 9\), we can establish the desired result as follows: \begin{equation} \begin{split} S(n)&=x_kx_{k-1}\cdots x_1x_0\\ &\leq x_k\cdot 9^k\\ &\leq x_k \cdot 10^k\\ &\leq x_k \cdot 10^k+x_{k-1}\cdot 10^{k-1}\ldots+x_1\cdot 10+x_0=n.\\ \end{split} \end{equation} This proves the result that \(n\geq S(n)\) for all natural numbers \(n\). \(\blacksquare\)

Using the result of the above lemma, we can now establish an ineqaulity in terms of one variable: $$S(n)=n^2-17n+56\leq n\Leftrightarrow n^2-18n+56=(n-4)(n-14)\leq 0\Leftrightarrow 4\leq n \leq 14.$$ Therefore, it suffices to check if the condition is satsifed for the natural numbers from \(4\) to \(14\). Stragithforward computations will prduce the follwoing table: \begin{array}{|c|c|c|} \hline n & n^2-17n+56 & S(n)\\ \hline 4 & 4 & 4\\ \hline 5 & -4 & 5\\ \hline 6 & -10 & 6\\ \hline 7 & -14 & 7\\ \hline 8 & -16 & 8\\ \hline 9 & -16 & 9\\ \hline 10 & -14 & 0\\ \hline 11 & -10 & 1\\ \hline 12 & -4 & 2\\ \hline 13 & 4 & 3\\ \hline 14 & 14 & 4\\ \hline \end{array} A simple way of getting the above values would have been to note that the \(x\)-value of the vertex of the parabola defined by \(y=x^2-17x+56\) is given by \(-\frac{b}{2a}=\frac{17}{2}=8.5\). Therefore, the value of \(n^2-17n+56\) would be symmetric about the point \(x=8.5\). From the table above, we can find that the only natural number that satsifes \(S(n)=n^2-17n+56\) is \(\boxed{n=4}\).

Comments