login
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.
2
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,7
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))).
EXAMPLE
The 2 relevant subsets of {1,2,3,4,5,6} are {1, 2, 5} and {1,2,3,6}.
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}]
CROSSREFS
Sequence in context: A055010 A266550 A081973 * A334276 A055496 A105120
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Oct 02 2022
STATUS
approved