This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A189052 #56 Jul 03 2020 19:09:32 %S A189052 0,0,0,1,4,14,42,118,314,806,2010,4902,11738,27686,64474,148518, %T A189052 338906,767014,1723354,3847206,8539098,18854950,41438170,90682406, %U A189052 197675994,429372454,929582042,2006430758,4318579674,9270965286,19854281690,42422744102,90452806618,192478164006 %N A189052 a(n) is the number of inversions in all compositions of n. %C A189052 Row sums of triangle in A189073. %H A189052 Nathaniel Johnston, <a href="/A189052/b189052.txt">Table of n, a(n) for n = 0..1000</a> %H A189052 M. Archibald, A. Blecher, A. Knopfmacher, M. E. Mays, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL23/Archibald/arch3.html">Inversions and Parity in Compositions of Integers</a>, J. Int. Seq., Vol. 23 (2020), Article 20.4.1. %H A189052 S. Heubach, A. Knopfmacher, M. E. Mays and A. Munagi, <a href="https://www.researchgate.net/publication/228671252_Inversions_in_compositions_of_integers">Inversions in Compositions of Integers</a>, Quaest. Math. 34 (2011), no. 2, 187-202. %H A189052 <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (5,-6,-4,8) %F A189052 a(n) = 2^(n-1)*(1/24*(n+2)*(n+1)-5/36*(n+1)-5/108)-2/27*(-1)^n for n>0. %F A189052 a(n) = +5*a(n-1) -6*a(n-2) -4*a(n-3) +8*a(n-4). %F A189052 G.f.: x^3*(1-x)/((1+x)*(1-2*x)^3). %e A189052 a(4)=4. There are eight compositions of 4. Five of these (the partitions of 4) have no inversions. The remaining three: 3+1, 2+1+1, 1+2+1 have 1,2,1 inversions respectively. - _Geoffrey Critzer_, Mar 19 2014 %p A189052 with(PolynomialTools):n:=33:taypoly:=taylor(x^3*(1-x)/((1+x)*(1-2*x)^3),x=0,n+1):seq(coeff(taypoly,x,m),m=0..n); # _Nathaniel Johnston_, Apr 17 2011 %p A189052 # second Maple program: %p A189052 a:= n-> `if`(n=0, 0, (<<0|1|0|0>, <0|0|1|0>, <0|0|0|1>, %p A189052 <8|-4|-6|5>>^n. <<-1/8, 0, 0, 1>>)[1, 1]): %p A189052 seq(a(n), n=0..40); # _Alois P. Heinz_, Apr 04 2016 %t A189052 nn=30;CoefficientList[Series[(1-x)*x^3/((1+x)*(1-x-x)^3),{x,0,nn}],x] (* _Geoffrey Critzer_, Mar 19 2014 *) %t A189052 LinearRecurrence[{5,-6,-4,8},{0,0,0,1,4},40] (* _Harvey P. Dale_, May 25 2016 *) %o A189052 (PARI) A189052(n)=2^(n-1)*(1/24*(n+2)*(n+1)-5/36*(n+1)-5/108)-2/27*(-1)^n; %o A189052 vector(33,n,A189052(n)) /* show terms */ /* _Joerg Arndt_, Apr 16 2011 */ %Y A189052 Cf. A264082, A271370, A271372. %Y A189052 Cf. A189073. %K A189052 nonn,easy %O A189052 0,5 %A A189052 _N. J. A. Sloane_, Apr 16 2011