# Thread: Digit sum & digit product of number x

1. ## Digit sum & digit product of number x

For every natural number x, let S(x) be the sum and P(x) the product of
the (decimal) digits of x. Show that for each natural number n there exist infinitely
many values of x such that. $S(S(x)) + P(S(x)) + S(P(x)) + P(P(x)) = n$

The problem is from final round of Austrian MO '83 and I really can't find any solution on the internet. So I am asking for help, maybe you know it, thanks in advance.

2. Originally Posted by fhactor
For every natural number x, let S(x) be the sum and P(x) the product of
the (decimal) digits of x. Show that for each natural number n there exist infinitely
many values of x such that. $S(S(x)) + P(S(x)) + S(P(x)) + P(P(x)) = n$

The problem is from final round of Austrian MO '83 and I really can't find any solution on the internet. So I am asking for help, maybe you know it, thanks in advance.
Here's one suggestion. Others may have neater constructions.

For positive integers p,q, let $x_{p,q}$ be the integer whose decimal form consists of p 1s followed by q 0s. In other words, $\displaystyle x_{p,q} = \sum_{j=q}^{p+q-1}10^j$. Then $S(x_{p,q}) = p$ and $P(x_{p,q}) = 0$. Now take $p=x_{n,1}$. Then $S(S(x_{p,q})) = S(x_{n,1}) = n$, and $P(S(x_{p,q})) = S(P(x_{p,q})) = P(P(x_{p,q})) = 0$. As q varies, that gives an infinite family of integers $x_{p,q}$ with $S(S(x_{p,q})) + P(S(x_{p,q})) + S(P(x_{p,q})) + P(P(x_{p,q})) = n$.