login
Number of compositions of n when each odd part can be of two kinds.
10

%I #48 Sep 08 2022 08:44:59

%S 1,2,5,14,38,104,284,776,2120,5792,15824,43232,118112,322688,881600,

%T 2408576,6580352,17977856,49116416,134188544,366609920,1001596928,

%U 2736413696,7476021248,20424869888,55801782272,152453304320

%N Number of compositions of n when each odd part can be of two kinds.

%C Also number of compositions of n into 2 sorts of parts where the kinds of parts are unordered inside a run of identical parts, see example. Replacing "unordered" by "ordered" gives A025192. - _Joerg Arndt_, Apr 28 2013

%C Numbers of straight-chain fatty acids involving oxo groups (or hydroxy groups), if cis-/trans isomerism is considered while stereoisomerism is neglected. - _Stefan Schuster_, Apr 19 2018

%H G. C. Greubel, <a href="/A052945/b052945.txt">Table of n, a(n) for n = 0..1000</a>

%H INRIA Algorithms Project, <a href="http://ecs.inria.fr/services/structure?nbr=1004">Encyclopedia of Combinatorial Structures 1004</a>

%H S. Schuster, M. Fichtner and S. Sasso, <a href="https://www.nature.com/articles/srep39821.pdf">Use of Fibonacci numbers in lipidomics - Enumerating various classes of fatty acids</a>, Sci. Rep., 7 (2017) 39821.

%H <a href="/index/Rec#order_02">Index entries for linear recurrences with constant coefficients</a>, signature (2,2).

%F G.f.: (1 - x)*(1 + x)/(1 - 2*x - 2*x^2).

%F a(n) = 2*(a(n-1) + a(n-2)).

%F a(n) = Sum_{alpha=RootOf(-1+2*z+2z^2)} alpha^(-1-n)/4.

%F From Al Hakanson (hawkuu(AT)gmail.com), Jun 29 2009: (Start)

%F a(n) = ((2+sqrt(3))*(1+sqrt(3))^(n-1) + (2-sqrt(3))*(1-sqrt(3))^(n-1))/2 for n>0.

%F First binomial transform of 2, 3, 6, 9, 18, 27, 54, 81, ... starting after 1. (End)

%e a(3)=14 because we have (3),(3'),(1,2),(1',2),(2,1),(2,1'),(1,1,1),(1,1,1'),(1,1',1),(1,1',1'),(1',1,1),(1',1,1'),(1',1',1) and (1',1',1').

%e There are a(3)=14 such compositions of 3. Here p:s stands for "part p of sort s":

%e 01: [ 1:0 1:0 1:0 ]

%e 02: [ 1:0 1:0 1:1 ]

%e 03: [ 1:0 1:1 1:1 ]

%e 04: [ 1:0 2:0 ]

%e 05: [ 1:0 2:1 ]

%e 06: [ 1:1 1:1 1:1 ]

%e 07: [ 1:1 2:0 ]

%e 08: [ 1:1 2:1 ]

%e 09: [ 2:0 1:0 ]

%e 10: [ 2:0 1:1 ]

%e 11: [ 2:1 1:0 ]

%e 12: [ 2:1 1:1 ]

%e 13: [ 3:0 ]

%e 14: [ 3:1 ]

%e - _Joerg Arndt_, Apr 28 2013

%p spec:= [S,{S=Sequence(Prod(Union(Sequence(Prod(Z,Z)),Sequence(Z)),Z))}, unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20);

%p seq(coeff(series((1-x^2)/(1-2*x-2*x^2), x, n+1), x, n), n = 0..30); # _G. C. Greubel_, Oct 18 2019

%t LinearRecurrence[{2,2,}, {1,2,5}, 30] (* _G. C. Greubel_, Oct 18 2019 *)

%o (PARI) Vec((x-1)*(1+x)/(-1+2*x+2*x^2)+O(x^30)) \\ _Charles R Greathouse IV_, Nov 20 2011

%o (Magma) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-x^2)/(1-2*x-2*x^2) )); // _G. C. Greubel_, Oct 18 2019

%o (Sage)

%o def A052945_list(prec):

%o P.<x> = PowerSeriesRing(ZZ, prec)

%o return P( (1-x^2)/(1-2*x-2*x^2) ).list()

%o A052945_list(30) # _G. C. Greubel_, Oct 18 2019

%o (GAP) a:=[2,5];; for n in [3..30] do a[n]:=2*(a[n-1]+a[n-2]); od; Concatenation([1], a); # _G. C. Greubel_, Oct 18 2019

%Y Row sums of A105474.

%K easy,nonn

%O 0,2

%A encyclopedia(AT)pommard.inria.fr, Jan 25 2000

%E More terms from _James A. Sellers_, Jun 05 2000

%E Better description from _Emeric Deutsch_, Apr 09 2005