Thursday, 28 July 2005

Mindbender 3: solution


This proved an interesting one. I shouldn't have done it today, but I needed a break from finishing my tax.

The problem comes down to finding a 3-digit number x such that (x^2)/7 - 4 produces a result of unknown length with x as the rightmost digits.

This didn't have the feel of a problem where iteration would work, and I felt that narrowing down the search space might be a good approach. Firstly, we can say that:

Because (x^2)/7 - 4 is an integer, then x is divisible by 7.

This slightly reduces the range of x from 100-999 to 105-994.

Secondly, we can get the final digit of x, using the 7 times table. For example, if x ends in 1, x^2 ends in 1, therefore (x^2)/7 ends in 3, and (x^2)/7 - 4 ends in 9.

Tabulating these: x, x^2, (x^2)/7, (x^2)/7 - 4
1, 1, 3, 9
2, 4, 2, 8
3, 9, 7, 3
4, 16, 8, 5
5, 25, 5, 1
6, 36, 8, 4
7, 49, 7, 3
8, 64, 2, 8
9, 81, 3, 9

So x must end in 8 or 9.

No comments:

Post a Comment