# Find all natural numbers $x$ such that ...

Find all natural numbers $x$ such that product of their digits is equal to $x^2-10x-22$

I've already found one such number it is $12$ because $(12)^2-10\cdot12-22=2$ and $1\cdot2=2$ but I don't know how should look formal solution

• product of their number? What does that mean? Which numbers are being multiplied? Specify. Apr 10, 2014 at 15:08
• If we have for instace number 12 then product of it's numbers is $1\cdot2=2$ Apr 10, 2014 at 15:10
• Product of their digits (or more precisely, their digits in base $10$). Apr 10, 2014 at 15:16
• Maybe you better write product of digits... Apr 10, 2014 at 15:17

If $x$ has just one digit, the product of the digits is $x$, so you are trying to solve $x=x^2-10x-22$ with $x$ in the range $0-9$, a standard quadratic.
If $x$ has two digits, let $x=10a+b$, with $1 \le a \le 9, 0 \le b \le 9$. Then you are asking $ab=(10a+b)^2-10(10a+b)-22=100a^2+20ab+b^2-100a-10b-22$ A quick search in a spreadsheet will check all the possibilities. Using mixed (fixed/relative) references you can just type the equation once, then copy right and down.
$x$ cannot have three digits, because $100^2-10\cdot 100 - 22=8978$ and the largest product of three digits is $729$
Let $d(x)$ denote the product of the digits of $x$. Consider a $n$-digit number $x$ with leading digit $n$, then $x\geq n10^{n-1}\geq n9^{n-1}\geq d(x)$. Therefore, $d(x)\leq x<x^2-10x-22$ for $x\geq 13$. Checking numbers from $1$ to $12$ we can see that $12$ is the only such number.
Hint: You can rule out a lot of possibilities with modular arithmetic. E.g. if the last digit is 4 or 8 then there can't be a solution because the product of digits will be divisible by $4$ but $x^2 - 10x - 22$ will only be divisible by $2$. Similarly the digit $2$ can only appear once in your number if it appears at the end. And if your number is odd, then it cannot contain any even digit because $x^2 - 10x - 22$ is odd for odd $x$. Also, if $x$ has $k$ digits then $x^2 - 10x - 22 > 10^{2k-2} - 10^{k+1} - 22$ while the product of digits is less than or equal to $9^k$. It is easy to see that this means $k$ can only be 1 or 2.