# For a positive integer $n$, $p_n$ denotes the product of the digits of n, and $s_n$ denotes the sum of the digits of n.

For a positive integer $n$, $p_n$ denotes the product of the digits of $n$, and $s_n$ denotes the sum of the digits of $n$. What is the number of integers between 10 and 1000 for which $p_n + s_n = n$ ?

Let $n = xy$ be the two digit number satisfying the given condition.

Given, the product of the digits of $n + \text{sum of the digits of$n$} = n$,

\begin{align} p_n + s_n &= n\\ xy + x + y &= 10x + y\\ 9x – xy &= 0\\ x (9 - y) &= 0. \end{align} But $x$ is not zero, because $xy$ is a two digit number.

So, $9 - y = 0 ⇒ y = 9$.

So, $xy$ can be 19, 29, 39, 49, 59, 69, 79, 89, and 99. i.e, 9 numbers.

Let $n = xyz$ be the three digit number satisfying the given condition.

Since $p_n + s_n = n$

\begin{align} xyz + x + y + z &= 100x + 10y + z.\\ 99x + 9y – xyz &= 0.\\ xyz &= 99x + 9y. \end{align}

• Why not just toss it on a computer, and try all the numbers from 10 to 1000? Jul 10, 2013 at 12:18
• Or note $xyz=99x+9y$ implies $xyz\ge99x$, $yz\ge99$, contradiction. Jul 10, 2013 at 12:20
• Basically these are the only solutions for $S(n)+P(n)=n$. As, if $n$ is a $k$ digit number the equation gives $9^k \geq P(n) \geq 9\sum_{r=0}^{k-1}10^r$. Which is true iff $k=2$. Jul 10, 2013 at 13:45

## 2 Answers

Given the conditions, your last equation doesn't have any solution. Let's see.

As $x \neq 0$ let's divide the equation by $x$: $$yz=99+ \frac{y}{x}$$ Therefore $x |y$.

But for $y=0$ there's no solution, and for $y \neq 0$:

$$yz >99 \Rightarrow y>10 \, \mathrm{or} \, z>10.$$ Which is impossible since $y$ and $z$ are digits.

Last equation modulo 11 is: $xyz \equiv 9(11x + y) \equiv 9y$mode$(11)$ so $xz \equiv 9$mode$(11)$ or $z \equiv 9 x^-1$ mode$(11)$. because $x$ and $z$ are digits, we have pairs $(1,9)$, $(2,6)$, $(3,3)$, $(4,3)$, $(5,4)$, $(6,2)$, $(7,6)$, $(8,8)$, $(9,1)$ for $(x,z)$. by putting in the original equation we see that there is no solution.