A357642 Number of even-length integer compositions of 2n whose half-alternating sum is 0.
1, 0, 1, 4, 13, 48, 186, 712, 2717, 10432, 40222, 155384, 601426, 2332640, 9063380, 35269392, 137438685, 536257280, 2094786870, 8191506136, 32063203590, 125613386912, 492516592620, 1932569186288, 7588478653938, 29816630378368, 117226929901676, 461151757861552
Offset: 0
Keywords
Examples
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)
Links
- David A. Corneth, Table of n, a(n) for n = 0..1665
Crossrefs
Programs
-
Mathematica
Table[Length[Select[Join @@ Permutations/@IntegerPartitions[2n],EvenQ[Length[#]]&&halfats[#]==0&]],{n,0,9}]
-
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
Extensions
More terms from Alois P. Heinz, Oct 12 2022
Comments