Sunday, October 26, 2008

Mathematical

I've felt like doing a few puzzles for some time now, so humor me for this one. The local bookstore had some copies of a book called Hard-to-Solve Math Puzzles (by Derrick Niederman), and the first random page that I opened had something that caught my attention:

It turns out to be impossible to "reverse" a number by multiplying it by 2. In other words, there is no number of the form abcd, for example, such that abcd x 2 = dcba. (The equation is not only impossible for four-digit numbers, it is impossible for all numbers.)

However, there is a three-digit number abc in base 8 such that abc x 2 = cba. Can you find that number?

This was quite tempting, so I thought I'd answer it here... especially since I'm too lazy to grab a sheet of paper right now.

Okay... the first given that we have is that A, B, and C are all non-negative, single-digit integers that are each less than 10. Assuming that the number ABC is in base 8, its base 10 (i.e. regular decimal) equivalent would be (A x 82) + (B x 81) + (C x 80).

ABC base 8
= (A x 82) + (B x 81) + (C x 80)
= 64A + 8B + C

Using the same logic for the reversed number CBA:

CBA base 8
= (C x 82) + (B x 81) + (A x 80)
= 64C + 8B + A

Back to the original equation:

(ABC base 8) x 2 = (CBA base 8)
> (64A + 8B + C) x 2 = (64C + 8B + A)
> 128A + 16B + 2C = 64C + 8B + A
> 127A + 8B - 62C = 0
> 127A + 8B = 62C

From here, the first gut instinct I've got is that A has to be an even number. This is because, in order for C to be an integer, (127A + 8B) must be evenly divisible by 62. Thus (127A +8B) must be an even number, therefore 127A must be an even number, and as a result, A must be an even number -- either 0, 2, 4, 6 or 8.

If A = 0, then 8B = 62C and the solution is indeterminate. If A = 6 or 8, then 62C becomes greater than 558, and C has to be greater than 9 (which does not fit the given). Therefore A is either 2 or 4.

If A = 4, then 8B + 508 = 62C. Since 62C can only be equal to 558 at this point, we have 8B + 508 = 558, and 8B = 50, which gives an indeterminate solution. Therefore A = 2.

Seeing that A = 2, then 8B + 254 = 62C. 62C can hypothetically be any value among 310, 372, 434, 496 and 558 -- these are the only values where 6C is greater than 254 and C is an integer less than 10.

However, since B cannot be greater than 9, the maximum possible value for 8B is 72. This means that 62C cannot be greater than 326. Therefore 62C can only be equal to 310.

If 62C = 310, then C = 5.

Thus 8B + 254 = 310, and 8B = 56. Thus B = 7, and ABC is therefore 275.

To wrap up with a reconstituted proof:

[(64 x 2) + (8 x 7) + (1 x 5)] x 2 = (64 x 5) + (8 x 7) + (1 x 2)
> (128 + 56 + 5) x 2 = (320 + 56 + 2)
> (189) x 2 = 378
> 378 = 378

...Yes, I'm aware that most people do Sudoku in their spare time, or maybe the odd word search or crossword puzzle. Yes, I'm crazy.

Now, let's see what's next...

No comments: