The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A331609 Number of compositions of n with the multiplicity of the first part even. 3

%I

%S 0,1,0,4,4,14,20,56,98,224,420,902,1764,3664,7258,14824,29596,59942,

%T 120012,241944,484946,975216,1955244,3926078,7870980,15790272,

%U 31650090,63456208,127162580,254845446,510582236,1022940392,2049048890,4104264424,8219808108

%N Number of compositions of n with the multiplicity of the first part even.

%H Alois P. Heinz, <a href="/A331609/b331609.txt">Table of n, a(n) for n = 1..1000</a>

%H M. Archibald, A. Blecher, A. Knopfmacher, M. E. Mays, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL23/Archibald/arch3.html">Inversions and Parity in Compositions of Integers</a>, J. Int. Seq., Vol. 23 (2020), Article 20.4.1.

%F 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)).

%F a(n) = A011782(n) - A331606(n). - _Alois P. Heinz_, Jan 23 2020

%e For n=4, a(4)=4 and counts 2+2, 1+2+1, 1+1+2 and 1+1+1+1.

%p b:= proc(n, p, t) option remember; `if`(n=0, t,

%p add(b(n-j, p, `if`(p=j, 1-t, t)), j=1..n))

%p end:

%p a:= n-> add(b(n-j, j, 0), j=1..n):

%p seq(a(n), n=1..38); # _Alois P. Heinz_, Jan 23 2020

%t 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}];

%t CL := CoefficientList[Series[gf[x], {x, 0, 35}], x]; Drop[CL, 1] (* _Peter Luschny_, Jan 23 2020 *)

%Y Cf. A011782, A331606 (similar with odd).

%K nonn

%O 1,4

%A _Arnold Knopfmacher_, Jan 22 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified September 26 20:34 EDT 2021. Contains 347672 sequences. (Running on oeis4.)