2
$\begingroup$

Question: find the size of a maximal subset $A$ of $[n]=\{1,\cdots,n\}$ satisfying that for any distinct elements $x,y\in A$, $x+y$ is not a perfect square.

Consider a graph with $n$ vertices: $x$ and $y$ are adjacent if $x+y$ is a perfect square. The question is equivalent to finding the size of a maximum independent set (a collection of non-adjacent vertices of the largest size). Note that each vertex is adjacent to as few as about $(\sqrt{2}-1)\sqrt{n}$ vertices (at vertex $n$) and as many as about $\sqrt{n}$ vertices (at vertex $1$).

I run a code using the greedy algorithm: take $1$; for each subsequent integer, take it if the sum of it and any taken integer is not a perfect square. The first few are \begin{equation*} 1,2,4,6,9,11,13,17,18,20... \end{equation*} There seems to be some patterns, but they fade away very quickly as the numbers get larger.

For $n=100$, the size given by the above algorithm is $31$; for $n=1000$, the size is $221$; for $n=4000$, the size is $845$; for $n=10000$, the size is $2172$; for $n=20000$, the size is $4461$.

Is it possible to estimate the size of a maximum independent set?

$\endgroup$
2
  • 3
    $\begingroup$ This is a well-known problem; see, for instance, "On Sets of Natural Numbers Whose Sumset is Free of Squares" by Tomasz Schoen (JCTA 88 (2), 1999, pp. 385-388) where it is shown that the density of such a set does not exceed $2/5$. $\endgroup$
    – Seva
    Commented Sep 21, 2023 at 15:21
  • 2
    $\begingroup$ oeis.org/A100719 $\endgroup$
    – RobPratt
    Commented Sep 21, 2023 at 15:43

0

You must log in to answer this question.

Browse other questions tagged .