Find a set of four consecutive six digit numbers which satisfies the following:
- The last four digits of the first (smallest) number form a palindrome.
- The last five digits of the second number form a palindrome.
- The second through fifth digits of the third number form a palindrome.
- The fourth (largest) number is a palindrome.
The fourth (largest) number is of the form
ABCCBA
To get the third number you subtract 1. In doing so, you can't do a "borrow" as that would upset the BCCB palindrome that is said to exist in that third number.
Working back another, the second number is supposed to be palindromic in the last 5 digits, so by this time, there has been a "borrow" and the B has changed to a C, and the A is now a B:
ABCCCB
so the A's must be 1's and the B's must be 9's, and the C must be one less than the B, and therefore are 8's.
The largest number is therefore
198891
and the earlier numbers follow:
198890
198889
198888
|
Posted by Charlie
on 2008-02-13 11:31:25 |