Problem

Let \( g: \mathbb{N} \to \mathbb{N} \) with g(n) being the product of the digits of n.

- Prove that \( g(n) \le n \) for all \( n \in \mathbb{N} \)
- Find all \( n \in \mathbb {N}\) for which \( n^2 -12n + 36 = g(n) \)

DIscussion

**(1)**Let,$$n=\sum_{i=0}^{k}10^{i}a_{i}.$$

Now,to prove that \(g(n)\leq n\),we have to show that ,$$\sum_{i=0}^{k}10^{i}a_{i}\ge \prod_{j=0}^{k}a_{i}.$$

Let us define the statement ,$$P(k):\sum_{i=0}^{k}10^{i}a_{i}\ge \prod_{j=0}^{k}a_{i}.$$

Now,\(P(0)\),\(P(1)\) is true for \(k=0\),\(k=1\),respectively because

\(a_{1}\in\{0,1,2,….,9\}\),which implies,that \(10a_{1}\ge a_{1}\)

Now by induction hypothesis,

Let us assume that \(P(k)\) is true for some \(k=m\),such that,

$$\sum_{i=0}^{m}10^{i}a_{i}\ge \prod_{j=0}^{m}a_{i}.$$

Now,we have \(a_{m+1}>a_{m+1}-1\) and \(10>a_{0},10>a_{1},\dots,10>a_{m}\)

Multiplying all of these we get $$10^{m+1}a_{m+1}>(a_{m+1}-1)a_{0}a_{1}\dots a_{m}=(a_{m+1}-1)\prod_{j=0}^{m}a_{j}.$$

\( \Rightarrow 10^{m+1}a_{m+1}+\sum_{i=0}^{m}10^{i}a_{i} \ge(a_{m+1}-1)a_{0}a_{1}\dots a_{m}+ \prod_{j=0}^{m}a_{i}\\ =(a_{m+1}-1)\prod_{j=0}^{m}a_{j}+\prod_{j=0}^{m}a_{j} \\ \Rightarrow \sum_{i=0}^{m+1}10^{m+1}a_{m+1}\ge\prod_{j=0}^{m+1}a_{j}\)

Hence,\(P(m+1)\) is true.

So,\(P(k)\) is true for all \(k\in\mathbb{N}\cup\{0\}\).

Thus,\(g(n)\leq n\),for all \(n\in\mathbb{N}\).

**(2)**Using \(g(n)\leq n\),we have $$n^2-12n+36\leq n$$.

$$=>n^2-13n+36=(n-4)(n-9)\leq0=>n\in[4,9].$$

Now,since \(n\in\mathbb{N}\),\(n=4,5,6,7,8,9\).

Also,\(n^2-12n+36=(n-6)^2=g(n)\),which implies \(g(n)\) is a perfect square.

Since,\(n<10\),\(g(n)=n\),which implies \(n\) is a perfect square.

But \(n\in[4,9]\) and hence only solutions are \(n=4,9\).

Isn’t the proof of the first part overkill? Why not just use , since ? The proof is both shorter and simple.

Correct…the concept used is same though.