Set of pairwise sum is the same Let $X=\{x_1,\ldots,x_n\},Y=\{y_1,\ldots,y_n\}$ be sets of pairwise distinct integers with $X\neq Y$. For which $n$ is it possible that $\{x_i+x_j\mid i<j\}=\{y_i+y_j\mid i<j\}$?
For example, $n=2$ is possible because of $\{1,4\},\{2,3\}$, $n=4$ is possible because of $\{1,4,6,7\},\{2,3,5,8\}$, and similarly any $n$ power of $2$ is possible.
 A: The purpose of this answer: We will prove that there exists two sets $A$ and $B$ such that $A\neq B$ and $$A+^*A=\{a+b\big/ a,b\in A,\ \ \ a\neq b\}=B+^*B=\{a+b\big/ a,b\in B,\ \ \ a\neq b\} $$ subsequently we will also use the notation $2*X=X+^*X$.

Let's consider the gollowing two sets:
$$ A=\{1,\cdots,n\}\backslash\{k\}\\
B=\{1,\cdots,n\}\backslash\{k+1\}$$

Claim For $n\geq 10$ there exists $k$ such that:$$2*A=A+^*A=B+^*B=2*B$$

Proof : In order to prove the claimed equality we use double inclusion:


*

*Given an element $a+b\in 2*A$ such that $a,b\in A$ are different elements, if neither $a$ or $b$ is equal to $k+1$ then $a+b\in 2*B$ otherwise, WLOG we can suppose that $b=k+1$, and this case is handled by $(2)$ in the a table below and because $(2)$ fails in exactly two cases we added $(3)$ and $(4)$.

*Given an element $a+b\in 2*B$ such that $a,b\in B$ are different elements, if neither $a$ or $b$ is equal to $k$ then $a+b\in 2*A$ otherwise, WLOG we can suppose that $A+K$, and this case is handled by $(5)$ in the a table below and because $(5)$ fails in exactly two cases we added $(6)$ and $(7)$.

*The condition $n\geq 10$ ensures that all the writing occurred in the table below are valid for example ($k+2$ must be different from $n-2$ in the case $(3)$ so that $k$ must exist$)


Table how can we transform elements in $2*A$ (or $2*B$) to the other sumset in the non obvious cases.
$$\begin{align}
    a,b        &&2*A           &&          && 2*B       \tag 1\\
a \in A        &&(k+1)+a       &&\to       &&k+(a+1)    \tag 2\\
a=k-1          &&(k+1)+(k-1)   &&\to       &&k+2+(k-2)  \tag 3\\
a=n            &&(k+1)+n       &&\to       &&k+2+(n-2)  \tag 4\\
b\in B         && k+1+(b-1)    &&\leftarrow&& k+b       \tag 5\\
b=k+2          &&(k-1)+(k+3)   &&\leftarrow&& k+(k+2)   \tag 6\\
b=1            &&(k-1)+2       &&\leftarrow&& k+1       \tag 7
\end{align}$$
