A032021 Number of compositions (ordered partitions) of n into distinct odd parts.
1, 1, 0, 1, 2, 1, 2, 1, 4, 7, 4, 7, 6, 13, 6, 19, 32, 25, 32, 31, 58, 43, 82, 49, 132, 181, 156, 193, 230, 325, 278, 457, 376, 715, 448, 967, 1290, 1345, 1386, 1723, 2276, 2341, 3116, 2959, 4750, 3823, 6358, 4681, 9480, 10945, 11832, 12169, 16442, 18793, 21002, 25537, 27820, 37687
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..10000
- C. G. Bower, Transforms (2)
Programs
-
Maple
b:= proc(n, i) b(n, i):= `if`(n=0, [1], `if`(i<1, [], zip((x, y) ->x+y, b(n, i-2), [0, `if`(i>n, [], b(n-i, i-2))[]], 0))) end: a:= proc(n) local l; l:= b(n, n-1+irem(n, 2)); a(n):= add(l[i]*(i-1)!, i=1..nops(l)) end: seq(a(n), n=0..100); # Alois P. Heinz, Nov 09 2012
-
Mathematica
b[n_, i_] := If[n == 0, {1}, If[i<1, {}, Plus @@ PadRight[{b[n, i-2], Join[{0}, If[i>n, {}, b[n-i, i-2]]]}]]]; a[n_] := Module[{l}, l = b[n, n-1+Mod[n, 2]]; Sum[l[[i]]*(i-1)!, {i, 1, Length[l]}]]; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Jan 30 2014, after Alois P. Heinz *)
-
PARI
N=66; q='q+O('q^N); gf=sum(k=0,N, k! * q^(k^2) / prod(j=1,k, 1-q^(2*j) ) ); Vec(gf) /* Joerg Arndt, Sep 17 2012 */
Formula
"AGK" (ordered, elements, unlabeled) transform of 1, 0, 1, 0...(odds)
G.f.: sum(k>=0, k! * x^(k^2) / prod(j=1..k, 1-x^(2*j) ) ). - Vladeta Jovovic, Aug 05 2004
Extensions
Prepended a(0)=1, Joerg Arndt, Oct 20 2012