%I M4129 #77 Jul 09 2023 17:50:58
%S 1,6,19,45,90,161,266,414,615,880,1221,1651,2184,2835,3620,4556,5661,
%T 6954,8455,10185,12166,14421,16974,19850,23075,26676,30681,35119,
%U 40020,45415,51336,57816,64889,72590,80955,90021,99826,110409,121810,134070
%N Coefficient of x^4 in expansion of (1+x+x^2)^n.
%C a(n) = A111808(n,4) for n>3. - _Reinhard Zumkeller_, Aug 17 2005
%C If a 2-set Y and 2-set Z, having one element in common, are subsets of an n-set X then a(n-3) is the number of 5-subsets of X intersecting both Y and Z. - _Milan Janjic_, Oct 03 2007
%C Antidiagonal sums of the convolution array A213781. [Clark Kimberling, Jun 22 2012]
%D L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 78.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%H Vincenzo Librandi, <a href="/A005712/b005712.txt">Table of n, a(n) for n = 2..1000</a>
%H Armen G. Bagdasaryan and Ovidiu Bagdasar, <a href="https://doi.org/10.1016/j.endm.2018.05.012">On some results concerning generalized arithmetic triangles</a>, Electronic Notes in Discrete Mathematics (2018) Vol. 67, 71-77.
%H R. K. Guy, <a href="/A005712/a005712.pdf">Letter to N. J. A. Sloane, 1987</a>
%H Milan Janjic, <a href="http://www.pmfbl.org/janjic/">Two Enumerative Functions</a>
%H Simon Plouffe, <a href="https://arxiv.org/abs/0911.4975">Approximations de séries génératrices et quelques conjectures</a>, Dissertation, Université du Québec à Montréal, 1992; arXiv:0911.4975 [math.NT], 2009.
%H Simon Plouffe, <a href="/A000051/a000051_2.pdf">1031 Generating Functions</a>, Appendix to Thesis, Montreal, 1992
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/TrinomialCoefficient.html">Trinomial Coefficient</a>
%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (5,-10,10,-5,1).
%F G.f.: (x^2)*(1+x-x^2)/(1-x)^5.
%F a(n) = binomial(n+2,n-2) + binomial(n+1,n-2) - binomial(n,n-2). - _Zerinvary Lajos_, May 16 2006
%F a(n) = 5*a(n-1) - 10*a(n-2) + 10*a(n-3) - 5*a(n-4) + a(n-5). _Vincenzo Librandi_, Jun 16 2012
%F a(n) = binomial(n,2) + 3*binomial(n,3) + binomial(n,4) (see our comment in A026729). - _Vladimir Shevelev_ and _Peter J. C. Moses_, Jun 22 2012
%F a(n) = GegenbauerC(N, -n, -1/2) where N = 4 if 4<n else 2*n-4. - _Peter Luschny_, May 10 2016
%F E.g.f.: exp(x)*x^2*(12 + 12*x + x^2)/24. - _Stefano Spezia_, Jul 09 2023
%p seq(binomial(n+2,n-2) + binomial(n+1,n-2) - binomial(n,n-2), n=2..50); # _Zerinvary Lajos_, May 16 2006
%p A005712:=(-1-z+z**2)/(z-1)**5; # Conjectured (correctly) by _Simon Plouffe_ in his 1992 dissertation.
%p A005712 := n -> GegenbauerC(`if`(4<n,4,2*n-4), -n, -1/2):
%p seq(simplify(A005712(n)), n=2..20); # _Peter Luschny_, May 10 2016
%t CoefficientList[Series[(1+x-x^2)/(1-x)^5,{x,0,40}],x] (* _Vincenzo Librandi_, Jun 16 2012 *)
%t LinearRecurrence[{5,-10,10,-5,1},{1,6,19,45,90},40] (* _Harvey P. Dale_, Apr 30 2015 *)
%o (Magma) I:=[1, 6, 19, 45, 90]; [n le 5 select I[n] else 5*Self(n-1)-10*Self(n-2)+10*Self(n-3)-5*Self(n-4)+Self(n-5): n in [1..40]]; _Vincenzo Librandi_, Jun 16 2012
%o (PARI) Vec((x^2)*(1+x-x^2)/(1-x)^5+O(x^99)) \\ _Charles R Greathouse IV_, Sep 23 2012
%Y Cf. A000574, A005581, A005714-A005716, A026729, A111808.
%Y a(n)= A027907(n, 4), n >= 2 (fifth column of trinomial coefficients).
%K nonn,easy
%O 2,2
%A _N. J. A. Sloane_
%E More terms from _Vladeta Jovovic_, Oct 02 2000