login
A357641
Number of integer compositions of 2n whose half-alternating sum is 0.
29
1, 0, 2, 8, 28, 104, 396, 1504, 5720, 21872, 83980, 323344, 1248072, 4828784, 18721080, 72711552, 282861360, 1101980000, 4298748300, 16789002736, 65641204200, 256895795312, 1006308200040, 3945185586368, 15478849767888, 60774329914144, 238775589937976
OFFSET
0,3
COMMENTS
We define the half-alternating sum of a sequence (A, B, C, D, E, F, G, ...) to be A + B - C - D + E + F - G - ...
LINKS
EXAMPLE
The a(0) = 1 through a(3) = 8 compositions:
() . (112) (123)
(1111) (213)
(1212)
(1221)
(2112)
(2121)
(11121)
(11211)
MAPLE
a:= proc(n) option remember; `if`(n<3, [1, 0, 2][n+1],
(8*(n-3)*(5*n-7)*(2*n-5)*a(n-3) -4*(5*n-12)*(n-2)^2*a(n-2)
+2*(2*n-5)*(5*n-7)*n*a(n-1))/((5*n-12)*(n+1)*(n-2)))
end:
seq(a(n), n=0..40); # Alois P. Heinz, Oct 19 2022
MATHEMATICA
halfats[f_]:=Sum[f[[i]]*(-1)^(1+Ceiling[i/2]), {i, Length[f]}];
Table[Length[Select[Join@@Permutations/@IntegerPartitions[2n], halfats[#]==0&]], {n, 0, 7}]
CROSSREFS
The skew-alternating version appears to be A001700.
The version for partitions is A035363.
The skew-alternating form is A088218 (also for full alternating sum).
These compositions are ranked by A357625, reverse A357626.
For reversed partitions we have A357639, ranked by A357631.
A124754 gives alternating sum of standard compositions, reverse A344618.
A357621 = half-alternating sum of standard compositions, reverse A357622.
A357637 counts partitions by half-alternating sum, skew A357638.
Sequence in context: A114590 A133592 A115967 * A150714 A292668 A122447
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 12 2022
EXTENSIONS
a(11)-a(26) from Alois P. Heinz, Oct 19 2022
STATUS
approved