Product of digits

Let F ( x ) F(x) be a function which returns the products of the digits of x x . E.g. F ( 27 ) = 14 , F ( 248 ) = 64 F(27)=14,F(248)=64 .

A A is the sum of F ( x ) F(x) over all 2-digit numbers (i.e. 10 x 99 10 \leq x \leq 99 )

B B is the sum of F ( x ) F(x) over all 3-digit numbers (i.e. 101 x 999 101 \leq x \leq 999 ).

Find B A \frac{B}{A}


The answer is 45.

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.

2 solutions

Sam Bealing
Apr 9, 2016

We can generalise this problem. Let S ( n ) S(n) be the sum over n-digit numbers.

For 1-digit numbers, the solution is: i = 0 9 i = 9 ( 9 + 1 ) 2 = 45 \sum_{i=0}^{9}i=\frac{9(9+1)}{2}=45 .

For n-digit numbers we have: S ( n ) = ( i = 1 9 i ) S ( n 1 ) = 45 S ( n 1 ) S(n)=(\sum_{i=1}^{9}i) S(n-1)=45 S(n-1) because all n-digit numbers are equivalent to the 2-digit numbers with the digits 1 to 9 on the front.

So we therefore have that S ( n ) = 4 5 n S(n)=45^n which we can show by induction.

Back to the question: A = S ( 2 ) = 4 5 2 , B = S ( 3 ) = 4 5 3 B A = 4 5 3 4 5 2 = 45 A=S(2)=45^2,B=S(3)=45^3 \Rightarrow \frac{B}{A}=\frac{45^3}{45^2}=45

Moderator note:

The explanation could be improved upon. I don't think that someone who doesn't know how to solve this problem would be able to understand where you are coming from / why the statements are true.

exactly same way I did

Atul Shivam - 5 years, 2 months ago

The explanation could be improved upon. I don't think that someone who doesn't know how to solve this problem would be able to understand where you are coming from / why the statements are true.

Calvin Lin Staff - 5 years, 2 months ago
Zakir Husain
May 21, 2020

Let us first find out individual value of A A and B B

A = n = 1 0 1 1 0 2 f ( n ) = ( 1 × 1 ) + ( 1 × 2 ) . . . + ( 2 × 1 ) + ( 2 × 2 ) . . . A=\sum_{n=10^1}^{10^2}f(n)=(1 \times 1)+(1 \times 2)...+(2 \times 1)+(2 \times 2)...

Taking the leading digits common from 1 1 to 9 9

A = 1 ( i = 1 9 i ) + 2 ( i = 1 9 i ) + 3 ( i = 1 9 i ) + 4 ( i = 1 9 i ) + 5 ( i = 1 9 i ) + 6 ( i = 1 9 i ) + 7 ( i = 1 9 i ) + 8 ( i = 1 9 i ) + 9 ( i = 1 9 i ) A=1(\sum_{i=1}^{9}i)+2(\sum_{i=1}^{9}i)+3(\sum_{i=1}^{9}i)+4(\sum_{i=1}^{9}i)+5(\sum_{i=1}^{9}i)+6(\sum_{i=1}^{9}i)+7(\sum_{i=1}^{9}i)+8(\sum_{i=1}^{9}i)+9(\sum_{i=1}^{9}i)

A = ( i = 1 9 i ) ( 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 ) = 45 × 45 = 4 5 2 A=(\sum_{i=1}^{9}i)(1+2+3+4+5+6+7+8+9)=45\times45=45^2

Now finding B B , we will remove number from 100 to 111 as all numbers in between will have a zero at 1 0 t h 10_{th} place. Similarly we will remove numbers between 200 and 201, 300 and 301, 400 and 401 and so on

B = n = 1 0 2 1 0 3 f ( n ) = ( 1 × f ( 11 ) ) + ( 1 × f ( 12 ) ) . . . + ( 2 × f ( 11 ) ) + ( 2 × f ( 12 ) ) . . . B=\sum_{n=10^2}^{10^3}f(n)=(1\times f(11))+(1\times f(12))...+(2\times f(11))+(2\times f(12))...

B = 1 ( f ( 11 ) + f ( 12 ) + f ( 13 ) . . . f ( 99 ) ) + 2 ( f ( 11 ) + f ( 12 ) + f ( 13 ) . . . f ( 99 ) ) + 3 ( f ( 11 ) + f ( 12 ) + f ( 13 ) . . . f ( 99 ) ) . . . B=1(f(11)+f(12)+f(13)...f(99))+2(f(11)+f(12)+f(13)...f(99))+3(f(11)+f(12)+f(13)...f(99))...

B = ( f ( 11 ) + f ( 12 ) + f ( 13 ) . . . f ( 99 ) ) ( 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 ) = ( 4 5 2 ) ( 45 ) = 4 5 3 B=(f(11)+f(12)+f(13)...f(99))(1+2+3+4+5+6+7+8+9)=(45^2)(45)=45^3

On dividing A and B

B A = 4 5 3 4 5 2 = 45 \frac{B}{A}=\frac{45^3}{45^2}=\boxed{45}

The solution is very neat!! Love it

Mahdi Raza - 1 year ago

This iteration can be generalised!!

Mahdi Raza - 1 year ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...