How can I describe the set of all numbers $n$ such that there are $n$ natural numbers $a_1, a_2, ... , a_n $ satisfying the condition: the differences $a_i-a_j$ are all the integers between $ \frac{-n(n-1)}{2} $, $\frac{n(n-1)}{2}$?
I tried solving this problem using induction. For base, I used $2$ equal numbers and the difference is obviously $0$, but I couldn't go further and I don't think it's the right way to go since I have to find feasible values for $n$ so all numbers shouldn't be valid.
Any ideas as where to start or how to solve this problem?
We claim that for only $n\in\{1,2,3,4\}$ does there exist integers $a_1,a_2,\ldots,a_n$ such that $$\big\{a_i-a_j\,\big|\,i,j\in\{1,2,\ldots,n\}\big\}=\left[-\binom{n}{2},+\binom{n}{2}\right]\cap\mathbb{Z}\,.\tag{*}$$ It is a trivial exercise to verify that each $n\in\{1,2,3,4\}$ works.
Let $n\geq 5$ be an integer. Write $N:=\binom{n}{2}$. Suppose on the contrary that there exist integers $a_1,a_2,\ldots,a_n$ with the property (*). Without loss of generality, we assume that $0=a_1<a_2<\ldots<a_n=N$. The condition (*) means that the pair differences of the form $a_i-a_j$ with $i>j$ are pairwise distinct positive integers from $1$ to $N$. Since there exists $a_i$ and $a_j$ such that $a_i-a_j=N-1$, we then deduce that either $(i,j)=(2,n)$ or $(i,j)=(1,n-1)$. We may again assume that $(i,j)=(2,n)$, whence $a_2=1$.
Now, we need a pair $\left(a_i,a_j\right)$ with difference $N-2$. It can be easily seen that $a_{n-1}=N-2$ must hold. So far, available (positive) pair differences are $1$, $2$, $N-3$, $N-2$, $N-1$, and $N$. The pair difference $N-4$ is still missing. From this, we conclude that $a_3=4$. Hence, the known numbers so far are $$a_1=0\,,\,\,a_2=1\,,\,\,a_3=4\,,\,\,a_{n-1}=N-2\,,\text{ and }a_n=N\,,$$ with the (positive) pair differences $$1\,,\,\,2\,,\,\,3\,,\,\,4\,,\,\,N-6\,,\,\,N-4\,,\,\,N-3\,,\,\,N-2\,,\,\,N-1\,,\text{ and }N\,.$$ The case $n=5$ is ruled out at this stage, as $N=10$, so $a_{n-1}-a_3=N-6=4=a_3-a_1$. Hence, there are no pairs $\left(a_i,a_j\right)$ with difference $N-5=5$.
For $n>5$, we need to find a pair $\left(a_i,a_j\right)$ whose difference is $N-5$. To get this pair difference, we need $a_{n-2}=N-5$, but then $$a_{n-1}-a_3=N-6=a_{n-2}-a_2\,,$$ which is a contradiction.
P.S.: I am very interested to know the maximal size of the set $\big\{a_i-a_j\,\big|\,i,j\in\{1,2,\ldots,n\}\big\}$ for an arbitrary positive integer $n$, provided that this set is a subset of $\left[-\binom{n}{2},+\binom{n}{2}\right]\cap\mathbb{Z}$. Does anybody know this result or any related literature to this problem? Maybe, someone may have seen a problem like the one below.