A357641 Number of integer compositions of 2n whose half-alternating sum is 0.
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
Keywords
Examples
The a(0) = 1 through a(3) = 8 compositions: () . (112) (123) (1111) (213) (1212) (1221) (2112) (2121) (11121) (11211)
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1664
Crossrefs
Programs
-
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}]
Extensions
a(11)-a(26) from Alois P. Heinz, Oct 19 2022
Comments