OFFSET
1,18
COMMENTS
A Sidon set is a set of natural numbers A={a_1,a_2,...}, finite or infinite, such that all pairwise sums a_i+a_j (i <= j) are different.
EXAMPLE
a(18)=8 since there are 8 subsets of {1,...,18} satisfying the required conditions, for example {1,2,5,11,13,18}.
MATHEMATICA
SidonQ[l__] := If[Length[Join[Plus @@@ Subsets[l, {2}], 2 l]] == Length[Union[Join[Plus @@@ Subsets[l, {2}], 2 l]]], True, False]
Table[Length@Select[Subsets[Range[n], {6}], SidonQ[#] &], {n, 1, 30}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Carl Najafi, Apr 27 2014
STATUS
approved