Size of set of integers with all sums of two distinct elements giving squares 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
 A: 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.
A: The size of such sets is bounded by some (unknown) constant, assuming a big conjecture in arithmetic geometry.
The Bombieri-Lang conjecture (non-trivially via the Uniformity Conjecture, see Stanley Yao Xiao's comment) implies that for any $f(x)\in \mathbb{Z}[x]$ of degree $5$, with no repeated roots, there are at most $B$ many rational numbers $m$ for which $f(m)$ is a square - here $B$ is some absolute constant (so the conjecture goes), completely independent of $f$.
This implies that the size of a set $A$ such that $a+a'$ is a square for any two distinct elements $a,a'\in A$ is at most $B+5$. Indeed, take any $5$ distinct elements $a_1,\ldots,a_5\in A$, and consider $f(x) = (x+a_1)\cdots(x+a_5)$. For any $m\in A\backslash \{a_1,\ldots,a_5\}$, we know that $f(m)$ is a square, and so $\lvert A\rvert-5\leq B$.
I learnt of this kind of argument (and the Uniformity Conjecture) via this paper of Cilleruelo and Granville, which has many similar arguments and applications: https://arxiv.org/pdf/math/0608109.pdf.
A: "D15 Numbers whose sums in pairs make squares" in Guy, Unsolved Problems in Number Theory, 3rd ed., credits Erdos and Leo Moser with asking "are there, for every $n$, $n$ distinct numbers such that the sum of any pair is a square?" Guy gives formulas for $n=3$ and $n=4$, and references to two papers of Lagrange (Jean, not Joseph-Louis): Cinq nombres dont les sommes deux à deux sont des carrés, Séminaire Delange-Pisot-Poitou (Théorie des nombres) 12^e année, 20 (1970-71) 10pp, and Six entiers dont les sommes deux à deux sont des carrés, Acta Arith. 40 (1981) 91-96.
The six integers Lagrange found are given by Guy as $$-15863902\qquad17798783\qquad21126338\qquad49064546\qquad82221218\qquad447422978$$
The section contains some related questions and references to the literature.
