Find the smallest two-digit positive integer that can be written as the sum of two distinct positive perfect squares in two different ways.
Note that is not allowed because is used twice.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
An integer n is expressible as the sum of two squares if and only if it is of the form n = A B 2 , where A is divisible only by primes not congruent to 3 m o d 4 and B is divisible only by primes congruent to 3 m o d 4 .
Writing A = 2 a p 1 a 1 ⋯ p k a k , the number of representations of n as a sum of two squares is r 2 ( n ) = 4 ( a 1 + 1 ) ( a 2 + 1 ) ( ⋯ ) ( a k + 1 ) . This formula (and the previous paragraph) comes from facts about Gaussian integers .
If n is not a square or twice a square, then the number of essentially different representations of n as a sum of two squares is r 2 ( n ) / 8 (there are eight different ways to write a 2 + b 2 as the sum of two squares if a and b are nonzero and distinct, by switching a and b and/or applying negative signs to one or both of them).
To make this number equal to 2 , we need ( a 1 + 1 ) ( a 2 + 1 ) = 4 , so setting a 1 = a 2 = 1 suggests taking n = 5 ⋅ 1 3 , which can indeed be written as 6 5 = 1 2 + 8 2 = 4 2 + 7 2 .
It's clear that this is the smallest possibility for n not equal to a square or twice a square, but there are only a few possibilities less than 6 5 which are a square or twice a square, and those can be spot-checked using the above formula.
(Yes, this is not the fastest solution, but it generalizes pretty well.)