OFFSET
1,7
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.
LINKS
Index entries for linear recurrences with constant coefficients, signature (2, 0, -1, 0, -2, 2, 0, 1, 0, -2, 1).
FORMULA
It appears to be the case that G.f.: 2*x^7*(1+3*x+3*x^2+5*x^3)/((1-x)^5*(1+x)^2*(1+x^2)*(1+x+x^2)), corrected by Vaclav Kotesovec, May 03 2014
a(n) ~ 1/24*n^4 (deduced from g.f.). - Ralf Stephan, Apr 29 2014
a(n) = a(n-11)+a(n-8)-a(n-3)+2*(a(n-6)+a(n-1)-a(n-10)-a(n-5)). - Fung Lam, May 02 2014
Explicit formula (derived from g.f.): a(n) = n^4/24 - 7*n^3/12 + 29*n^2/12 - 15*n/8 - floor(n/4) - 4/3*floor(n/3) + (n/2-9/4)*floor(n/2) - floor((n+1)/4) - 2/3*floor((n+1)/3). - Vaclav Kotesovec, May 03 2014
EXAMPLE
a(7)=2 since the only subsets of {1,...,7} satisfying the required conditions are {1,2,5,7} and {1,3,6,7}.
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], {4}], SidonQ[#] &], {n, 1, 30}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Carl Najafi, Apr 27 2014
STATUS
approved