OFFSET
1,12
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(12)=4 since the only subsets of {1,...,12} satisfying the required conditions are {1,2,5,10,12}, {1,3,8,9,12}, {1,3,8,11,12}, and {1,4,5,10,12}.
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], {5}], SidonQ[#] &], {n, 1, 30}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Carl Najafi, Apr 27 2014
STATUS
approved