A211164 Number of compositions of n with at most one odd part.
1, 1, 1, 3, 2, 8, 4, 20, 8, 48, 16, 112, 32, 256, 64, 576, 128, 1280, 256, 2816, 512, 6144, 1024, 13312, 2048, 28672, 4096, 61440, 8192, 131072, 16384, 278528, 32768, 589824, 65536, 1245184, 131072, 2621440, 262144, 5505024, 524288, 11534336, 1048576, 24117248
Offset: 0
Examples
a(3) = 3: [3], [1,2], [2,1]. a(4) = 2: [4], [2,2]. a(5) = 8: [5], [3,2], [2,3], [1,4], [4,1], [1,2,2], [2,1,2], [2,2,1]. a(6) = 4: [6], [4,2], [2,4], [2,2,2]. a(8) = 8: [8], [4,4], [2,6], [6,2], [2,2,4], [4,2,2], [2,4,2], [2,2,2,2].
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (0,4,0,-4)
Programs
-
Maple
a:= n-> `if`(n<2, 1, 2^iquo(n-2, 2) * `if`(irem(n, 2)=0, 1, iquo(n+3, 2))): seq(a(n), n=0..60);
-
PARI
Vec((1-x)^2*(1+x)*(1+2*x)/(1-2*x^2)^2 + O(x^50)) \\ Colin Barker, May 07 2016
Formula
G.f.: -(2*x^4-x^3-3*x^2+x+1)/(-4*x^4+4*x^2-1).
From Colin Barker, May 07 2016: (Start)
a(n) = 2^((n-7)/2+5/2) for n>0 and even.
a(n) = 2^((n-7)/2)*(2*n+6) for n>0 and odd.
a(n) = 4*a(n-2)-4*a(n-4) for n>4.
(End)