Sidon set (source code)

= Sidon set
{wiki}

A Sidon set in an <abelian group> is a subset $A$ for which an equality $a+b=c+d$ with $a,b,c,d\in A$ forces the unordered pairs $\{a,b\}$ and $\{c,d\}$ to be equal. Equivalently, the ordered nonzero differences $a-b$ with $a\ne b$ are all distinct.