Simple Math problem

• Jun 8th 2013, 10:54 AM
ashoksingh
Simple Math problem
There are two number a and b. both are four digit numbers . a is reverse of b and a is four time of b.
a = reverse(b)
AND
a = 4*b
how to find a and b? with explaination
• Jun 8th 2013, 02:52 PM
HallsofIvy
Re: Simple Math problem
Write the digits of a as "pqrs". The a= 1000p+ 100q+ 10r+ s and b= 1000s+ 100r+ 10q+ p. a= 4b becomes 1000p+ 100q+ 10r+ s= 4(1000s+ 100r+ 10q+ s).

If p, q, r, and s could be any real numbers there would be an infinite number of solutions. But here we know that p, q, r, and s must be integers from 0 to 9 (and, presumably, neither p nor s are 0).
• Jun 8th 2013, 06:22 PM
Soroban
Re: Simple Math problem
Hello, ashoksingh!

Quote:

$\text{There are two four-digit numbers, }a\text{ and }b.$
. . $a\text{ is the reverse of }b.$
. . $a\text{ is four times }b.$

$\text{Find }a\text{ and }b.$

$\text{Let }\,\begin{Bmatrix}a &=& DCBA \\ b &=& ABCD \end{Bmatrix}$

$\text{We have an "alphametic":}$

. . $\begin{array}{cccc}_1&_2&_3&_4 \\ A&B&C&D \\ \times &&& 4 \\ \hline D&C&B&A \end{array}$

$\text{In column-1 }(c_1)\text{, we see that }4A \,=\,D$.
$\text{Since }D\text{ is a digit, }A\text{ must be }1\text{ or }2$.

$\text{In }c_4\text{, we see that }D\times 4\text{ ends in }A.$
. . $\text{Hence, }A\text{ must be even: }\:A = 2.$

$\text{We have:}$

. . $\begin{array}{cccc}_1&_2&_3&_4 \\ 2&B&C&D \\ \times &&& 4 \\ \hline D&C&B&2 \end{array}$

$\text{In }c_1\text{, we see that }D = 8\text{ or }9.$
$\text{In }c_4\text{, we see that }D\times 4\text{ ends in }2.$
. . $\text{Hence: }\,D \,=\,8$

$\text{We have:}$

. . $\begin{array}{cccc}_1&_2&_3&_4 \\ 2&B&C&8 \\ \times &&& 4 \\ \hline 8&C&B&2 \end{array}$

$\text{In }c_2,\,4B+ \text{(carry)}\,=\,C.$
. . $\text{Hence, }B\text{ must be }0\text{ or }1.$

$\text{If }B = 0\text{, then }c_3\text{ says: }\,4C + 3\text{ ends in }0.$
. . $\text{This is impossible, so }\,B = 1.$

Finally, we have:

. . $\begin{array}{cccc} 2&1&7&8 \\ \times &&& 4 \\ \hline 8&7&1&2 \end{array}$
• Jun 9th 2013, 08:44 AM
sakonpure6
Re: Simple Math problem
I can do a C++ program for you to solve the problem if you want?!
• Jun 9th 2013, 05:43 PM
topsquark
Re: Simple Math problem
Quote:

Originally Posted by sakonpure6
I can do a C++ program for you to solve the problem if you want?!

It's a nice gesture, but I wouldn't think that a program would help the OP learn the method all that well...

-Dan