All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 The reversed numbers (Posted on 2005-09-16)
Both a and b are four-digit numbers and one is obtained from the other by reversing the digits.

Determine them, knowing that 2 * (a + b) = 5 * (b - 1).

 Submitted by pcbouhid Rating: 4.5000 (4 votes) Solution: (Hide) We are given that2 * (a + b) = 5 * (b - 1)Working with this equation, we have :3b - 2a = 5........(eq. 1)From this we can conclude that :a = 1.5b (approximately, since a and b are 4-digit numbers).....(eq. 2)If we represent the smaller 4-digit number b by the string pxyq, then the larger 4-digit number a is the string qyxp.The equation (2) places restrictions on the combinations of first and last digits p and q that our numbers a and b can have.The following table lists all the possible 4-digit combinations for the numbers a and b based on the restrictions imposed by equation (2) above: b a ------------ 1xy2 2yx1 2xy3 3yx2 2xy4 4yx2 3xy4 4yx3 3xy5 5yx3 4xy6 6yx4 4xy7 7yx4 5xy7 7yx5 5xy8 8yx5 6xy9 9yx6 For any of the above possibilities we have, from equation (1) above, the following:3b - 2a = 5or3 * (1000p + 100x + 10y + q) - 2 * (1000q + 100y + 10x + p) = 5300x + 30y + 3 * (1000p + q) - 200y - 20x - 2 * (1000q + p) = 5which we can rearrange as(280x - 170y) + 3000p - 2000q = 2p - 3q + 5......(eq. 3)The variables p, q, x, and y are all single-digit positive integers, so the left-hand side of this equation is divisible by 10. So, the right-hand side of the equation must therefore also be divisible by 10.The table above shows all the possible combinations of digits p and q; let's find which of those combinations satisfy the condition that (2p - 3q + 5) is divisible by 10: p q (2p - 3q + 5) --------------------------- 1 2 2 - 6 + 5 = 1 2 3 4 - 9 + 5 = 0 2 4 4 - 12 + 5 = -3 3 4 6 - 12 + 5 = -1 3 5 6 - 15 + 5 = -4 4 6 8 - 18 + 5 = -5 4 7 8 - 21 + 5 = -8 5 7 10 - 21 + 5 = -6 5 8 10 - 24 + 5 = -9 6 9 12 - 27 + 5 = -10So now there are only two possibilities for the digits p and q:(p,q) = (2,3)or(p,q) = (6,9)Now let's try each of these two possibilities in equation (3) above, remembering that p, q, x, and y are single-digit integers.(280x - 170y) + 3000p - 2000q = 2p - 3q + 5For (p,q) = (2,3) we find :280x - 170y + 6000 - 6000 = 4 - 9 + 5 = 0280x - 170y = 028x - 17y = 0The only solution in single-digit integers for this equation is (x,y) = (0,0); this gives us one solution to the problem :p = 2 , q = 3, x = y = 0.We have :b = 2003a = 3002Checking :2 * (3002 + 2003) = 5 * (2003 - 1)2 * 5005 = 5 * 200210010 = 10010For (p,q) = (6,9) we find :280x - 170y + 18000 - 18000 = 12 - 27 + 5 = - 10280x - 170y = - 1028x - 17y = - 1We now solve this as a diophantine equation with x and y single-digit integers:17y = 28x + 117y = 17x + 11x + 1y = x + (11x + 1)/17 The expression (11x + 1) must be divisible by 17; trying single-digit integer values for x, we have :11 * 1 + 1 = 1211 * 2 + 1 = 2311 * 3 + 1 = 3434 is divisible by 17. So we now have :x = 3y = 3 + (34/17) = 3 + 2 = 5.And we find a second solution to the problem:p = 6, x = 3, y = 5, q = 9.We have:b = 6359a = 9536Checking:2 * (9536 + 6359) = 5 * 63582 * 15895 = 5 * 635831790 = 31790Thus we have two solutions to the problem:(a,b) = (3002,2003)and(a,b) = (9536,6359)

 Subject Author Date re: Less brute force goFish 2005-09-17 10:40:47 More brute force Charlie 2005-09-16 19:38:29 Two answers Old Original Oskar! 2005-09-16 19:30:53 re: Solution Leming 2005-09-16 19:28:03 Second Solution np_rt 2005-09-16 19:28:01 re: Solution Charlie 2005-09-16 19:24:34 Solution Andre 2005-09-16 19:13:05

 Search: Search body:
Forums (0)