login
A232534
Number of subsets of {1,...,n} containing n and having at least one set partition into 3 blocks with equal element sum.
3
0, 0, 0, 0, 1, 2, 5, 12, 29, 63, 146, 329, 722, 1613, 3505, 7567, 16119, 34194, 71455, 148917, 307432, 631816, 1290905, 2628736, 5330368
OFFSET
1,6
COMMENTS
Subsets with more than one set partition into 3 blocks with equal element sum are counted only once: {1,2,3,4,5,6,7,8}-> 1236/48/57, 138/246/57, 156/237/48.
EXAMPLE
a(5) = 1: {1,2,3,4,5}-> 14/23/5.
a(6) = 2: {1,2,4,5,6}-> 15/24/6, {1,2,3,4,5,6}-> 16/25/34.
a(7) = 5: {2,3,4,5,7}-> 25/34/7, {1,3,4,6,7}-> 16/34/7, {1,2,5,6,7}-> 16/25/7, {1,2,3,5,6,7}-> 17/26/35, {2,3,4,5,6,7}-> 27/36/45.
a(8) = 12: {2,3,5,6,8}, {1,3,5,7,8}, {1,2,6,7,8}, {2,3,4,6,7,8}, {1,2,3,4,5,7,8}, {1,3,4,5,6,8}, {1,2,4,5,6,7,8}, {1,2,3,6,7,8}, {3,4,5,6,7,8}, {1,2,4,5,7,8}, {1,2,3,4,5,6,7,8}, {1,2,3,4,6,8}.
MAPLE
b:= proc(n, k, i) option remember; local m; m:= i*(i+1)/2;
`if`(k>n, b(k, n, i), `if`(i<1, `if`(n=0 and k=0, {0}, {}),
`if`(k>=0 and n+k>m or k<0 and n-2*k>m, {}, b(n, k, i-1)
union map(p-> p+x^i, b(n+i, k+i, i-1) union b(n-i, k, i-1)
union b(n, k-i, i-1)))))
end:
a:= n-> nops(b(n, n, n-1)):
seq(a(n), n=1..15);
MATHEMATICA
b[n_, k_, i_] := b[n, k, i] = Module[{m = i*(i + 1)/2}, If[k > n, b[k, n, i], If[i < 1, If[n == 0 && k == 0, {0}, {}], If[k >= 0 && n + k > m || k < 0 && n - 2*k > m, {}, b[n, k, i - 1] ~Union~ Map[# + x^i &, b[n + i, k + i, i - 1] ~Union~ b[n - i, k, i - 1] ~Union~ b[n, k - i, i - 1]]]]]];
a[n_] := Length[b[n, n, n - 1]];
Table[a[n], {n, 1, 20}] (* Jean-François Alcover, May 25 2018, translated from Maple *)
CROSSREFS
Cf. A164934, A232466 (2 blocks).
Column k=3 of A248112.
Sequence in context: A162036 A321253 A290073 * A274594 A062422 A320553
KEYWORD
nonn,more
AUTHOR
Alois P. Heinz, Nov 25 2013
EXTENSIONS
a(25) from Alois P. Heinz, Mar 26 2016
STATUS
approved