Tricky Triads

What is the smallest perfect square that can be expressed as the sum of two positive perfect squares in two different ways?

Note : The order of summation doesn't matter.


The answer is 625.

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.

2 solutions

Patrick Corn
Jun 23, 2016

An integer n n is expressible as the sum of two squares if and only if it is of the form n = A B 2 , n = A B^2, where A A is divisible only by primes not congruent to 3 m o d 4 3 \bmod 4 and B B is divisible only by primes congruent to 3 m o d 4. 3 \bmod 4.

Writing A = 2 a p 1 a 1 p k a k , A = 2^a p_1^{a_1} \cdots p_k^{a_k}, the number of representations of n n as a sum of two squares is r 2 ( n ) = 4 ( a 1 + 1 ) ( a 2 + 1 ) ( ) ( a k + 1 ) . r_2(n) = 4(a_1+1)(a_2+1)(\cdots)(a_k+1). This formula (and the previous paragraph) comes from facts about Gaussian integers .

If n n is a square and we want to write it as the sum of two positive squares in two essentially different ways, we'll want r 2 ( n ) 20. r_2(n) \ge 20. This is because there are four ways to write n = k 2 + 0 2 = ( k ) 2 + 0 2 = 0 2 + k 2 = 0 2 + ( k ) 2 , n = k^2 + 0^2 = (-k)^2 + 0^2 = 0^2+k^2 = 0^2 +(-k)^2, none of which help us, and then an actual representation of n = a 2 + b 2 n=a^2+b^2 as a sum of two positive squares will give rise to eight different representations counted in r 2 ( n ) r_2(n) (by switching a a and b b and/or applying negative signs to one or both of them.)

So we want r 2 ( n ) 20 r_2(n) \ge 20 and all the a i a_i even. Both a 1 = 4 a_1=4 and a 1 = a 2 = 2 a_1=a_2=2 will work, and any other choices will lead to larger numbers. The smallest example of the former is 5 4 = 625 , 5^4 = 625, and the smallest example of the latter is ( 5 2 1 3 2 = 4225. (5^2 \cdot 13^2 = 4225. So the answer is 625 . \fbox{625}. The two representations are 625 = 1 5 2 + 2 0 2 = 7 2 + 2 4 2 . 625 = 15^2+20^2 = 7^2 + 24^2.

Aleksa Janković
Aug 19, 2016

Here is a little python code i came up with, probably it's not the most optimal solution but it works just fine ;)

def perfectSquare():

nums=[]

for i in range (1,10000):
    for j in range (1,100):
        for k in range (1,100):
            if i==j*j+k*k and i!=1 and \
            not j in nums and not k in nums and \
            (math.sqrt(i) % 1 == 0): 
                    nums.append(j)
                    nums.append(k)
    if len(nums) == 4 :
        print nums,
        print nums[0]*nums[0]+nums[1]*nums[1]
    del nums[:]

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...