OFFSET
0,4
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
David A. Corneth, Table of n, a(n) for n = 0..1665
EXAMPLE
The a(0) = 1 through a(4) = 13 compositions:
() . (1111) (1212) (1313)
(1221) (1322)
(2112) (1331)
(2121) (2213)
(2222)
(2231)
(3113)
(3122)
(3131)
(111311)
(112211)
(113111)
(11111111)
MATHEMATICA
Table[Length[Select[Join @@ Permutations/@IntegerPartitions[2n], EvenQ[Length[#]]&&halfats[#]==0&]], {n, 0, 9}]
PROG
(PARI) a(n) = {my(v, res); if(n < 3, return(1 - bitand(n, 1))); res = 0; v = vector(2*n, i, binomial(n-1, i-1)); forstep(i = 4, 2*n, 2, lp = i\4 * 2; rp = i - lp; res += v[lp] * v[rp]; ); res } \\ David A. Corneth, Oct 13 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Gus Wiseman, Oct 12 2022
EXTENSIONS
More terms from Alois P. Heinz, Oct 12 2022
STATUS
approved