login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A331609
Number of compositions of n with the multiplicity of the first part even.
3
0, 1, 0, 4, 4, 14, 20, 56, 98, 224, 420, 902, 1764, 3664, 7258, 14824, 29596, 59942, 120012, 241944, 484946, 975216, 1955244, 3926078, 7870980, 15790272, 31650090, 63456208, 127162580, 254845446, 510582236, 1022940392, 2049048890, 4104264424, 8219808108
OFFSET
1,4
LINKS
M. Archibald, A. Blecher, A. Knopfmacher, M. E. Mays, Inversions and Parity in Compositions of Integers, J. Int. Seq., Vol. 23 (2020), Article 20.4.1.
FORMULA
G.f.: (1-x)/(1-2*x) - Sum_{i>=1} ((x-1)*x^i*(-x^(i+1)+x^i-2*x+1)) / ((2*x-1) * (-2*x^(i+1)+2*x^i-2*x+1)).
a(n) = A011782(n) - A331606(n). - Alois P. Heinz, Jan 23 2020
EXAMPLE
For n=4, a(4)=4 and counts 2+2, 1+2+1, 1+1+2 and 1+1+1+1.
MAPLE
b:= proc(n, p, t) option remember; `if`(n=0, t,
add(b(n-j, p, `if`(p=j, 1-t, t)), j=1..n))
end:
a:= n-> add(b(n-j, j, 0), j=1..n):
seq(a(n), n=1..38); # Alois P. Heinz, Jan 23 2020
MATHEMATICA
gf[x_] := (1 - x)/(1 - 2 x) - Sum[ ((x - 1) x^i (-x^(i + 1) + x^i - 2 x + 1)) / ((2 x - 1) (-2 x^(i + 1) + 2 x^i - 2 x + 1)), {i, 1, 40}];
CL := CoefficientList[Series[gf[x], {x, 0, 35}], x]; Drop[CL, 1] (* Peter Luschny, Jan 23 2020 *)
CROSSREFS
Cf. A011782, A331606 (similar, with odd).
Sequence in context: A326982 A263797 A376531 * A174406 A270844 A287286
KEYWORD
nonn
AUTHOR
Arnold Knopfmacher, Jan 22 2020
STATUS
approved