Find the largest six-digit number that is divisible by and whose digits read the same forwards and backwards (a palindrome).
Write down the shape of a six-digit palindrome. Any such number looks like
with digits and . Three free digits instead of six — that alone cuts the search from numbers to .
Split the divisibility condition. Since and , a number is divisible by exactly when it is divisible by both and . Handling the two prime factors separately is what makes the problem doable by hand.
Use the rule for 5 to pin down the first digit. Divisibility by requires the last digit to be or . In a palindrome the last digit equals the first, and a six-digit number cannot start with , so
and the number has the form . Every candidate therefore starts in the -hundred-thousands — no palindrome multiple of can begin with or higher.
Apply the rule for 3 to the digit sum. The digits sum to
This must be divisible by . Working modulo , , which forces
Maximise the digits from the left. The leading digits weigh most, so try first. Then must satisfy , i.e. , so and the largest is . This is also why the tempting fails: its digit sum is , not a multiple of .
Assemble and verify. With , , the number is
Check: it ends in , so it is divisible by ; its digits sum to , divisible by ; and indeed
Since is the largest possible second digit and the largest admissible third digit, no larger six-digit palindrome works.
Need to solve a different problem like this? Open the solver →