A357292 a(n) = number of subsets S of {1,2,...,n} having more than 2 elements such that (sum of least two elements of S) = difference between greatest two elements of S.
0, 0, 0, 0, 0, 1, 2, 5, 11, 23, 47, 96, 193, 388, 778, 1558, 3118, 6239, 12480, 24963, 49929, 99861, 199725, 399454, 798911, 1597826, 3195656, 6391316, 12782636, 25565277, 51130558, 102261121, 204522247, 409044499, 818089003, 1636178012, 3272356029
Offset: 0
Examples
The 2 relevant subsets of {1,2,3,4,5,6} are {1, 2, 5} and {1,2,3,6}.
Links
- Index entries for linear recurrences with constant coefficients, signature (2,1,-1,-2,-1,2).
Programs
-
Mathematica
s[n_] := s[n] = Select[Subsets[Range[n]], Length[#] >= 3 &]; a[n_] := Select[s[n], #[[1]] + #[[2]] == #[[-1]] - #[[-2]] &] Table[Length[a[n]], {n, 0, 16}]
Formula
a(n) = 2*a(n-1) + a(n-2) - a(n-3) - 2*a(n-4) - a(n-5) + 2*a(n-6).
G.f.: -(x^5/((-1 + x)^2 (1 + x) (-1 + 2 x) (1 + x + x^2))).