cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A357642 Number of even-length integer compositions of 2n whose half-alternating sum is 0.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 12 2022

Keywords

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 - ...

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)
		

Crossrefs

The skew-alternating version appears to be A000984.
For original alternating sum we have A001700/A088218.
The version for partitions of any length is A357639, ranked by A357631.
For length multiple of 4 we have A110145.
These compositions of any length are ranked by A357625, reverse A357626.
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.

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