Sum and product of digits

Let S ( n ) S(n) denote the sum of the digits of n n and P ( n ) P(n) denote the products of the digits of n n . Find the number of positive integers n n such that

n = S ( n ) + P ( n ) \large{n=S(n)+P(n)}

In other words, find the number of positive integers n n equal to the sum of the digits added to the product of its digits.


The answer is 9.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Joseph Newton
Jan 12, 2019

Let the number n n have k + 1 k+1 digits, which are d 0 , d 1 , d 2 , , d k d_0,d_1,d_2,\dots,d_k where d k d_k is the first digit and d 0 d_0 is the last.

n = S ( n ) + P ( n ) d 0 + 10 d 1 + 1 0 2 d 2 + + 1 0 k d k = ( d 0 + d 1 + d 2 + + d k ) + ( d 0 d 1 d 2 d k ) ( 10 1 ) d 1 + ( 1 0 2 1 ) d 2 + + ( 1 0 k 1 ) d k = ( d 0 d 1 d 2 d k ) \begin{aligned}n&=S(n)+P(n)\\ \therefore d_0+10d_1+10^2d_2+\dots+10^kd_k&=(d_0+d_1+d_2+\dots+d_k)+(d_0d_1d_2\dots d_k)\\ (10-1)d_1+\left(10^2-1\right)d_2+\dots+\left(10^k-1\right)d_k&=(d_0d_1d_2\dots d_k)\end{aligned}

Taking away some terms from the left hand side (which must all be zero or positive) gives the following inequality:

( 1 0 k 1 ) d k d 0 d 1 d 2 d k 1 0 k 1 d 0 d 1 d 2 d k 1 \begin{aligned}\left(10^k-1\right)d_k&\leq d_0d_1d_2\dots d_k\\ 10^k-1&\leq d_0d_1d_2\dots d_{k-1}\end{aligned}

The largest value each of d 0 , d 1 , d 2 , , d k d_0,d_1,d_2,\dots,d_k can take is 9. We can be sure the equality is still satisfied if we let these variables be their maximal value, so:

1 0 k 1 9 × 9 × 9 × × 9 k 9 ’s 1 0 k 1 9 k 1 0 k 1 9 k 1 ( 10 1 ) 1 0 k 1 1 0 k 1 ( 10 1 ) since 1 0 k 1 9 k 1 for k 1 1 0 k 1 1 0 k 1 ( 10 ) 1 0 k 1 1 0 k 1 1 0 k 1 0 k 1 1 0 k 1 1 k 1 0 k 1 \begin{aligned}10^k-1&\leq\underbrace{9\times9\times9\times\dots\times9}_{k\ 9\text{'s}}\\ 10^k-1&\leq9^k\\ 10^k-1&\leq9^{k-1}(10-1)\\ 10^k-1&\leq10^{k-1}(10-1)&\text{since }10^{k-1}\geq9^{k-1}\text{ for }k\geq1\\ 10^k-1&\leq10^{k-1}(10)-10^{k-1}\\ 10^k-1&\leq10^k-10^{k-1}\\ 10^{k-1}&\leq1\\ k-1&\leq0\\ k&\leq1\end{aligned} For single digit numbers (i.e. k = 0 k=0 ), n = S ( n ) = P ( n ) n=S(n)=P(n) , and so these are clearly not possible. Therefore the only possibility is where k = 1 k=1 , i.e. 2-digit numbers.

Now that we know the numbers must have 2 digits, we can simplify the above expressions to two variables; a a , the first digit, and b b , the second digit.

n = S ( n ) + P ( n ) 10 a + b = ( a + b ) + ( a b ) 9 a = a b b = 9 \begin{aligned}n&=S(n)+P(n)\\ \therefore10a+b&=(a+b)+(ab)\\ 9a&=ab\\ b&=9\end{aligned}

Therefore we simply require 2-digit numbers that end in a 9, and there are 9 \boxed{9} such numbers: 19 , 29 , 39 , 49 , 59 , 69 , 79 , 89 , 99 19,\ 29,\ 39,\ 49,\ 59,\ 69,\ 79,\ 89,\ 99

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...