3
$\begingroup$

My child got a question in school (grade) that is:

Find biggest and smallest 3 digits number, which has sum of it's digits equal to product of those digits.

Help please since I cannot explain my child this question.

Example would be:

$1+2+3=1\cdot 2\cdot 3$

$3+2+1=3\cdot 2\cdot 1$

Numbers 123 and 321

But this is just example of this, how to solve it as a problem.

3 Answers 3

0
def test(num):     numS = str(num) # convert the number to a string     sum = int(numS[0])     prod = int(numS[0])     for i in range(1,3): # iterate through the string         sum += int(numS[i])         prod *= int(numS[i])     if sum == prod: # test to see if the product & sum are equal         return(True)  numbers = [] # create a list of all numbers that meet the criteria for number in range(100,1000):     if test(number):         numbers.append(number)  numbers.sort # sort the list of numbers print(numbers[0],numbers[-1]) # print the beg and end of the list 
7

Clearly $0$ cannot be one of the digits: if it were, the product would be $0$, and the sum would not. We can’t have two $1$’s: if the remaining digit is $c$, the product is $c$, but the sum is $c+2$. This means that the smallest two digits must be at least $1$ and $2$.

It’s easy to check that the digits cannot all be the same: the only solutions of the equation $a^3=3a$ are $a=0$ and $=\pm\sqrt3$, none of which is possible in this problem. Thus, if the digits are $a,b$, and $c$, with $a\le b\le c$, we must have $a.

We already know that $b\ge 2$; suppose that $b\ge 3$; then $abc\ge bc\ge 3c>a+b+c$, since we know that $a. Thus, there is no solution with $b\ge 3$. There is also no solution with $a=b=2$: that would require $4c=4+c$, $3c=4$ and $c=4/3$, which is impossible. Thus, every solution must have $a=1$ and $b=2$. This means that $2c=3+c$, whose only solution is $c=3$.

Thus, the three digits must be $1,2$, and $3$. The smallest number that can be formed from them is $123$, and the largest is $321$.

4

So, we need find digits $a,b,c$ such that $a+b+c=abc$

Clearly, $abc \ne 0$, if $a=0,b+c=0\implies b=c=0$

So, $\frac{a+b}{ab-1}=c$ which is integer.

(1)If $ a=3m+1,b=3n+1$ or $a=3m-1,b=3n-1$

$3\mid (ab-1)$, but $3 ∤ (a+b)\implies (ab-1) ∤(a+b)$

(2)If $ a=3m\le 9,b=3n\le 9\implies 1\le m,n\le 3$

$ \frac{a+b}{ab-1}=\frac{3(m+n)}{9mn-1}$

$\implies (9mn-1)\mid (m+n)$ as $(9mn-1,3)=1$

But $(m+n)\le 3+3=6$

$\implies (9mn-1)\le 6$ which is clearly impossible as $m,n \ge 1$.

(3)If $ a=3m+1\le 9 ,b=3n-1\le 9\implies 0\le m\le 2, 1\le n\le 3 $,

$ \frac{a+b}{ab-1}=\frac{3(m+n)}{(3m+1)(3n-1)-1}$

$\implies (3m+1)(3n-1)-1\mid (m+n)$ as $((3m+1)(3n-1)-1,3)=(3(3mn-m+n)-2,3)=1$

$ (3m+1)(3n-1)-1\le 5\implies (3m+1)(3n-1) \le 6\implies m\le1$ and $n\le 2$

If $m=1\implies 3m+1=4\implies 3n-1\le 1\implies n<1$, but $1\le n\le 3 $

If $m=0$, $\frac{3(m+n)}{(3m+1)(3n-1)-1} \ becomes \frac{3n}{3n-2}$

$\implies (3n-2)\mid 3n\implies (3n-2)\mid n$ as $(3n-2,3)=1$

So, $3n-2\le n\implies n\le 1$ ,but $1\le n\le 3$ so, $n=1$

So, $a=1,b=2\implies c=\frac{a+b}{ab-1}=3$

As $a+b+c=abc$ is symmetric $a=3,b=1$ and $a=3,b=2$ will also be solutions corresponding to cases (4) $a=3m,b=3n+1$ and (5) $a=3m,b=3n-1$ respectively.

So, the only solution is $1,2,3$.

Clearly, $321$ is the largest and $123$ is the smallest.