TITLE: Size of set of integers with all sums of two distinct elements giving squares
QUESTION [19 upvotes]: Are there arbitrarily large sets $\mathcal S=\{a_1,\ldots,a_n\}$ of strictly positive integers such that all sums $a_i+a_j$ of two distinct elements in $\mathcal S$ are squares?
Considering subsets in $\mathbb Z$ should essentially give the same answer since such a set can contain at most one negative integer.
An example of size $3$ is given by $\{6,19,30\}$.
(Allowing $0$, one gets $\{0,a^2,b^2\}$ in bijection with
Pythagorean triplets $c^2=a^2+b^2$.)
There is no such example with four integers in $\{1,\ldots,1000\}$.
(Accepting $0$, solutions are given by Euler bricks:
$\{0,44^2,117^2,240^2\}$ is the smallest example. I suspect thus that there are strictly positive solutions in $\mathbb N^4$).
An equivalent reformulation: Consider the infinite graph with vertices $1,2,3,\ldots$ and edges $\{i,j\}$ if $i+j$ is a square.
Does this graph contain arbitrarily large complete subgraphs?
(Trivial observation: Every edge $\{a,b\}$ is only contained in finitely many different complete subgraphs.)
Motivation This is somehow a variation on question Generalisation of this circular arrangement of numbers from $1$ to $32$ with two adjacent numbers being perfect squares

REPLY [3 votes]: This is more of a comment than an answer.
This problem has been considered by many, but the problem is that the solution is reduced to solving a system of Diophantine equations of the 2nd degree. Even in some special cases, the solutions are quite complex and cumbersome.
As the number of unknowns increases, the number of equations that need to be solved faster than the number of unknowns in them increases. And the complexity in the solution and parametrization increases very quickly. If for 3 unknowns, you can write a simple parameterization... even for a more complex system.
https://artofproblemsolving.com/community/c3046h1055253_the_system_of_equations_15
https://artofproblemsolving.com/community/c3046h1172008_combinations_of_numbers_in_squares
Then for 4 unknowns it is quite a difficult task and parameterization looks cumbersome.
https://artofproblemsolving.com/community/c3046h1052122_the_system_of_diophantine_equations
In this topic there is a link to the article how Euler solved this system for 4 unknowns.
https://artofproblemsolving.com/community/c6h602478
Generally speaking. It is extremely difficult to find parametrizations of systems of Diophantine equations. That's probably why this is the most ignored direction in research. Diophantus dedicated his book to the system of equations... but no one mentions it.