login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A238159 Number of compositions of n with exactly one part equal to 1 or exactly one part equal to 2. 1

%I #12 May 01 2014 09:41:57

%S 0,1,1,2,5,11,15,35,70,124,234,447,827,1529,2834,5222,9587,17573,

%T 32137,58641,106821,194280,352824,639913,1159238,2097759,3792375,

%U 6849778,12361822,22292405,40172089,72344671,130203409,234200988,421037335,756538955,1358728300

%N Number of compositions of n with exactly one part equal to 1 or exactly one part equal to 2.

%H Alois P. Heinz, <a href="/A238159/b238159.txt">Table of n, a(n) for n = 0..1000</a>

%F G.f.: x*A(x)^2 + x^2*B(x)^2 - 2*x^3*C(x)^3 where A(x)=1/(1 - (x/(1-x)-x)), B(x)=1/(1 - (x/(1-x)-x^2)), C(x)=1/(1 - (x/(1-x)-x-x^2)).

%F a(n) ~ c * n / (2^(n-1) * d^n), where c = 0.02749202171174083217... is the root of the equation -1 + 18*c + 552*c^2 + 4232*c^3 = 0 and d = 0.2849201454990266329... is the root of the equation -1 + 4*d - 4*d^2 + 8*d^3 = 0. - _Vaclav Kotesovec_, May 01 2014

%e a(4) = 5 because we have: 1+3, 3+1, 1+1+2, 1+2+1, 2+1+1.

%t nn=30;a=1/(1-(x/(1-x)-x));b=1/(1-(x/(1-x)-x^2));c=1/(1-(x/(1-x)-x-x^2));CoefficientList[Series[a^2x +b^2x^2-2 c^3x^3,{x,0,nn}],x]

%t (* or *)

%t Table[Length[Select[Level[Table[Select[Compositions[n,k],Count[#,0]==0&],{k,1,n}],{2}],Count[#,1]==1||Count[#,2]==1&]],{n,0,10}]

%Y Cf. A006367 exactly one part equal to 1, A079662 exactly one part equal to 2 (with appropriate offset).

%K nonn

%O 0,4

%A _Geoffrey Critzer_, Feb 18 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 13 16:28 EDT 2024. Contains 375144 sequences. (Running on oeis4.)