When I was in primary 6, I got the following math problem (not from my teacher):

I am a two digit number. I am equal to the sum of my digits multiplied by my first digit. Which number am I?

Post your answer in the comment below (with the workings or just simple explanation of how you got the answer).

I got the answer by programming.The two-digit number is 24 or 45.

I wrote the program in Java:

——- for(int i = 1;i <= 9;i ++){ for(int j = 0;j <= 9;j ++){ if(10 * i + j == (i + j) * j){ System.out.println(“The two-digit number is “+(10 * i + j));

——-

Wu Baoqin· 20 January 2011, 17:16 · #Hi Baoqin, your answer is not correct. Please note the second sentence of the problem: “I am equal to the sum of my digits multiplied by my

firstdigit.”Your answer will work if it were multiplied by

seconddigit, i.e. 24 = 4(2+4) and 45 = 5(4+5).Try again! :-)

Jimmy· 20 January 2011, 17:36 · #sorry, I have made the naive mistake.Now it is the correct answer.The two-digit number is 48.

The programming code in Java is:

——-

for(int i = 1;i <= 9;i ++){ for(int j = 0;j <= 9;j ++){ if(10 * i + j == (i + j) * i){ System.out.println(“The two-digit number is “+(10 * i + j));

}

}

}

Wu Baoqin· 21 January 2011, 05:33 · #@Baoqin: Yes, that’s right :-)

Jimmy· 21 January 2011, 06:05 · #Thank you. Could you tell how you solve this problem. If possible, could you mail your solution to my email?

Wu Baoqin· 22 January 2011, 09:19 · #The answer is 48

Solution:

As the number is two digit, it is in the form of **=/x/y/, where y is the ones term and x is the tens term. Hence the no is equal to

N= 10x+y ——-(1) Also given that the number is equal to sum of its digits multiplied by its first digit. Hence the number N=(x+y)x ——-(2)Equating (1)and (2) gives

10x+y=(x+y)xSolving the above equation for y,

y=(10x-x^2)/(x-1)The limit for x, such the y be positive is

1<x<10.

Substitute the values for x from 2,3,…9, and find y. When x=4, y=8, is the only value that satisfies the given condition. Hence the result is 48

Rilwanullah· 13 February 2011, 14:11 · #24

Oladipupo femi· 28 November 2011, 06:34 · #