Palindromic Hypotenuses?

34 Views Asked by At

What is the largest seven-digit palindrome which can be expressed as the sum of two perfect squares?

I tried Java but couldn't get the right answer, and unfortunately OEIS ends at around 5 digits in.

2

There are 2 best solutions below

2
On

$9896989$ is prime and is $\equiv 1\pmod 4$, hence is the sum of two squares.

0
On

It can't end in $99$ since that is $3$ mod $4$. Therefore it can't start with $99$, so the next-highest prefix is $98$. Searching numbers of the form $989?989$ quickly yields $9896989$.