|
| |
|
|
A113980
|
|
Number of compositions of n with an odd number of 1's.
|
|
0
| |
|
|
1, 0, 3, 2, 10, 12, 36, 56, 136, 240, 528, 992, 2080, 4032, 8256, 16256, 32896, 65280, 131328, 261632, 524800, 1047552, 2098176, 4192256, 8390656, 16773120, 33558528, 67100672, 134225920, 268419072, 536887296, 1073709056, 2147516416
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,3
|
|
|
FORMULA
| 2^(n-2)-2^((n-2)/2) if n is even, else 2^(n-2)+2^((n-3)/2).
G.f.=z(1-z)^2/[(1-2z)(1-2z^2)]. - Emeric Deutsch (deutsch(AT)duke.poly.edu), Feb 03 2006
|
|
|
EXAMPLE
| a(4)=2 because only the compositions 31 and 13 of 4 have an odd number of 1's (the other compositions are 4,22,211,121,112 and 1111).
|
|
|
MAPLE
| a:=proc(n) if n mod 2 = 0 then 2^(n-2)-2^((n-2)/2) else 2^(n-2)+2^((n-3)/2) fi end: seq(a(n), n=1..38); (Deutsch)
|
|
|
MATHEMATICA
| f[n_] := If[EvenQ[n], 2^(n - 2) - 2^((n - 2)/2), 2^(n - 2) + 2^((n - 3)/2)]; Array[f, 34] (* Robert G. Wilson v *)
|
|
|
CROSSREFS
| Cf. A020522, A007582, A063083, A100818, A092295, A111752, A111753, A111723, A111724, A088336, A088506.
Cf. A105422.
Sequence in context: A103245 A019242 A064367 * A095675 A006743 A091811
Adjacent sequences: A113977 A113978 A113979 * A113981 A113982 A113983
|
|
|
KEYWORD
| easy,nonn
|
|
|
AUTHOR
| Vladeta Jovovic (vladeta(AT)eunet.rs), Jan 31 2006
|
|
|
EXTENSIONS
| More terms from Robert G. Wilson v (rgwv(at)rgwv.com) and Emeric Deutsch (deutsch(AT)duke.poly.edu), Feb 01 2006
|
| |
|
|