Problems & Puzzles: Puzzles

Puzzle 109. a1<a2<...<ak such that...

Here you are asked to find k distinct integers a1<a2<...<ak such that  the sum of any two of them is a square.

The problem becomes a rather interesting one when you are asked to find the particular set of k values if ak is conditioned to be the smallest prime possible number, for each k=>2

Here are the solutions that I have found for the first k values:


Set of ak values


{-1, 2}


{-4, 20, 29} wrong!!!...

{-4, 4, 5} found by Imran Ghory, 30/9/2000


{-622, 626, 818, 1583}








1. Can you extend the above table for k= 5, 6 & 7
2. Can you demonstrate why for k=>3 all the numbers in the set must be even numbers except the prime number

n. b.: This puzzle is an extension of one published by Frank Rubin in one of his extremely interesting puzzles for fun's pages. But the less restricted problem (ak is neither prime nor minimal) "...goes back to T. Baker who found (1839) five integers whose sum in pairs were squares and C. Gill who found (1848) five whose sum in three were squares" . In 1972 Jean Lagrange found one solution with 6 integers. Erdös & Leo Moser ask (when?) if exist solutions for any quantity (k) of integers.(cfr. D15, pp. 170-171, R. K. Guy, UPiNT")

Chris Nash & Jud McCranie has solved independently the question 2; their respective argument is the same:

"Think in terms of 'mod 4'. All perfect squares leave a remainder of zero or one on division by 4. Now suppose two of the three numbers are odd. Their sum is even, and to be an even square, it must be a multiple of 4. So one of the odd numbers leaves a remainder of 1, the other a remainder of 3, after division by 4. So say a=1 mod 4, b=3 mod 4. It's quick to check the possible values of c mod 4:

c=0 mod 4: b+c=3 mod 4, cannot be square
c=1 mod 4: a+c=2 mod 4, cannot be square
c=2 mod 4: a+c=3 mod 4, cannot be square
c=3 mod 4: b+c=2 mod 4, cannot be square

So if a and b are both odd, there is no solution for c. So we're forced to conclude at most one of the numbers can be odd."


Giovanni Resta wrote (Nov. 2004)

I found this set for K=5.
-25822, 31298, 43778, 114626, 351863

The sums are




Records   |  Conjectures  |  Problems  |  Puzzles