|
|
A060945
|
|
Number of compositions (ordered partitions) of n into 1's, 2's and 4's.
|
|
13
|
|
|
1, 1, 2, 3, 6, 10, 18, 31, 55, 96, 169, 296, 520, 912, 1601, 2809, 4930, 8651, 15182, 26642, 46754, 82047, 143983, 252672, 443409, 778128, 1365520, 2396320, 4205249, 7379697, 12950466, 22726483, 39882198, 69988378, 122821042, 215535903, 378239143, 663763424, 1164823609
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
INVERT transform of the aerated Fibonacci sequence (1, 0, 1, 0, 2, 0, 3, 0, 5, ...).
a(n) = term (4,4) in the n-th power of the matrix [0,1,0,0; 0,0,1,0; 0,0,0,1; 1,0,1,1]. (End)
Number of permutations satisfying -k <= p(i)-i <= r and p(i)-i not in I, i=1..n, with k=1, r=3, I={2}. - Vladimir Baltic, Mar 07 2012
Number of compositions of n if the summand 2 is frozen in place or equivalently, if the ordering of the summand 2 does not count. - Gregory L. Simay, Jul 18 2016
In general, the number of compositions of n with summand k frozen in place is equal to the number of compositions of n with only summands 1,...,k,2k. - Gregory L. Simay, May 10 2017
|
|
LINKS
|
|
|
FORMULA
|
a(n) = a(n-1) + a(n-2) + a(n-4).
G.f.: 1 / (1 - x - x^2 - x^4).
a(n) = Sum_{k=0..floor(n/2)} Sum_{i=0..n-k} C(i, n-k-i)*C(2*i-n+k, 3*k-2*n+2*i). - Paul Barry, Oct 24 2005
|
|
EXAMPLE
|
There are 18=a(6) compositions of 6 with the summand 2 frozen in place: (6), (51), (15), (4,[2]), (3,3) (411), (141), (114), (3[2]1), (1[2]3)), ([222]), (3111), (1311), (1131), (1113), ([22]11), ([2]1111), (111111). Equivalently, the position of the summand 2 does not affect the composition count. For example, (321)=(231)=(312) and (123)=(213)=(132).
|
|
MAPLE
|
m:= 40; S:= series( 1/(1-x-x^2-x^4), x, m+1);
|
|
MATHEMATICA
|
LinearRecurrence[{1, 1, 0, 1}, {1, 1, 2, 3}, 39] (* or *)
CoefficientList[Series[1/(1-x-x^2-x^4), {x, 0, 38}], x] (* Michael De Vlieger, May 10 2017 *)
|
|
PROG
|
(Haskell)
a060945 n = a060945_list !! (n-1)
a060945_list = 1 : 1 : 2 : 3 : 6 : zipWith (+) a060945_list
(zipWith (+) (drop 2 a060945_list) (drop 3 a060945_list))
(PARI)
N=66; my(x='x+O('x^N));
Vec(1/(1-x-x^2-x^4))
(Magma)
R<x>:=PowerSeriesRing(Integers(), 40);
Coefficients(R!( 1/(1-x-x^2-x^4) )); // G. C. Greubel, Apr 09 2021
(Sage)
P.<x> = PowerSeriesRing(ZZ, prec)
return P( 1/(1-x-x^2-x^4) ).list()
|
|
CROSSREFS
|
Same as unsigned version of A077930.
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|