# Set of 3 numbers which any two of the elements sum to a square number

A set of 3 numbers (2,34,47) has properties :

• Its elements are positive integer numbers under 50.
• Its elements are 3 different numbers.
• Any two of the elements sums to a square number. (2+34 = 36, 2 + 47 = 49, 34 + 47 = 81, (36,49,81) are square numbers)
• The elements sum to 83.

Find another set with equals properties, but the elements sum under 83.

The check mark is for the smallest sum.

• Are they all positive integers? – boboquack Dec 2 '17 at 22:49
• @boboquack: Yes, thank you for asking. – Jamal Senjaya Dec 2 '17 at 22:51
• Is 0 included? – ibrahim mahrir Dec 2 '17 at 23:32
• @ibrahimmahrir 0 is not +integer. – Jamal Senjaya Dec 2 '17 at 23:46
• Next puzzle should be to find a set of 4 integers (or 5, or n) with similar property... – Evargalo Dec 4 '17 at 8:51

I get:

(6, 19, 30)

Which:

Add to 25, 36 and 49

And have sum:

55

How I got to this:

Let's consider the smallest square we use. It has to be at least 2, so first we try 4.
If so, two numbers must be 1 and 3, but then the other squares have to be two apart, which is impossible.
If we try 9, the two numbers must be at most as far apart as 1 and 8, so seven or less apart. The only way to do this with squares at least 9 is with 9 and 16, but then we have (1, 8, 8) where two of the numbers are the same.
If we try 16, the two numbers must be at most as far apart as 1 and 15. But also, since 16 is even, the two numbers that add up to it must be either both even or both odd. So the difference is even, and the difference between the two squares is also even. But then the difference is at least 36-16=20, which is bigger than 15-1=14.
So we finally try 25. Note that all the squares have to be distinct, hence the differences have to be distinct (otherwise a+b=S and b+c=S, which implies a=c, and then we would have two numbers equal). So trying the smallest two squares bigger than 25, we have 25, 36 and 49, which gives (6, 19, 30).

• This wins because it's the smallest possible solution. Maybe add a derivation/proof? – greenturtle3141 Dec 2 '17 at 23:39
• @greenturtle3141 Done. – boboquack Dec 2 '17 at 23:54
• This isn't really a very satisfying proof, just brute-forcing. I tried to formalize it in my answer. – smci Dec 3 '17 at 6:14
• @smci but minimisation questions over integers usually come to this, unfortunately. Chances are, if it's not a simple answer like (1, 2, 3), it will require brute-forcing. – boboquack Dec 3 '17 at 8:11
• @smci I disagree. The OP wanted the minimal example (smallest sum). Candidates were individually considered and disproved until the minimal one was found. In this case, that is all the searching that was needed. I find this satisfying. The term "brute force" is a snarl term which I think is unfairly used to describe proofs or solution-searches which are enough for the job and where nothing more complex was needed. – Rosie F Dec 3 '17 at 9:22

Here is one:

$(5, 20, 44)$

Where:

$0 < 5 \leq 50$ ; $0 < 20 \leq 50$ ; $0 < 44 \leq 50$

and:

$5 \neq 20 \neq 44 \neq 5$

and:

$5 + 20 = 25 = 5^2$ ; $5 + 44 = 49 = 7^2$ ; $20 + 44 = 64 = 8^2$

and:

$5 + 20 + 44 = 69 < 83$

• 0 is not positive. Also, nitpick is that if $a\neq b\neq c$, $a$ could still be equal to $c$, so you would need to write $a\neq b\neq c\neq a$. – boboquack Dec 2 '17 at 23:30

Trying to outline an actual proof why @boboquack's result is minimal; please comment on how to finish this:

Let the numbers involved be $(a,b,c)$, WLOG in increasing order, and the squares involved be $(X,Y,Z)$ WLOG in increasing order. (Clearly X,Y,Z are distinct, otherwise at least two of the a,b,c would also be identical).

Then we must have $a+b=X, a+c=Y, b+c=Z$ for $a_i \geq 1$

Now we're trying to minimize the sum S of the numbers, which gives us a constraint on the sum of squares: $S = a+b+c = (X+Y+Z)/2$

Write $x^2=X, y^2=Y, z^2=Z$ and in fact $X=x^2, Y=(x+u)^2, Z=(x+u+v)^2$ for some positive integers $u,v \geq 1$. (We suspect our solution has u=v=1 and minimal x)

Then our constraint on S becomes:

$2S = 2(a+b+c) = (X+Y+Z) = x^2 + (x+u)^2 + (x+u+v)^2$
$= 3x^2 + 2(2u+v)x + u^2+(u+v)^2$

Now consider how we partition $X=a+b$ into two positive integer parts (a,b) in increasing order. The number of ways of doing that is $\lfloor X/2 \rfloor$, and the difference (b-a) is at most (X-2). Clearly we must have $x \geq 3$, i.e. $X \geq 9$

Similarly to @boboquack we use that to get a minimum value on X, and hence x. Then u,v. This then gives us the minimal $S_{min}$. We are told $S_{min} \leq (6^2+7^2+9^2)/2 = 83$

Another unused line of attack: Note the residues of the x,y,z modulo 3 must be (0,1,2) in some order. And the residues mod-3 of the squares $x^2=X, y^2=Y, z^2=Z$ must be $(0, 1, 2^2 \equiv 1)$ in some order. Similarly show by contradiction that one of the x,y,z is divisible by 4.

• I've fixed up your spoilering, but there are unbalanced brackets in the second spoiler. – boboquack Dec 3 '17 at 8:14