A187925 Coefficient of x^n in (1+x+x^2+x^3+x^4)^n.
1, 1, 3, 10, 35, 121, 426, 1520, 5475, 19855, 72403, 265233, 975338, 3598180, 13311000, 49360405, 183424355, 682870587, 2546441085, 9509714340, 35561166195, 133138728845, 499005557515, 1872137642125, 7030166054250, 26421479140746, 99376657487396
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..200
Programs
-
Magma
P
:=PolynomialRing(Integers()); [Coefficients((1+x+x^2+x^3+x^4)^n)[n+1]: n in [0..26]]; // Vincenzo Librandi, Aug 09 2014 -
Mathematica
Pentanomial[n_, k_] := If[k == 0, 1, Coefficient[(1 + x + x^2 + x^3 + x^4)^n, x^k]] Table[Pentanomial[n, n], {n, 0, 12}]
-
Maxima
pentanomial(n,k):=coeff(expand((1+x+x^2+x^3+x^4)^n),x,k); makelist(pentanomial(n,n),n,0,12);
-
Maxima
a(n):=sum(binomial(n,r)*sum((sum(binomial(j,-r+n-m-j)*binomial(m,j),j,0,m))*binomial(r,m),m,0,r),r,0,n); /* Vladimir Kruchinin, Feb 03 2013 */
-
Maxima
a(n):=sum((-1)^i*binomial(n,i)*binomial(2*n-5*i-1,n-5*i),i,0,n/5); /* Vladimir Kruchinin, Mar 28 2019 */
-
PARI
a(n) = polcoeff((1+x+x^2+x^3+x^4)^n, n); \\ Michel Marcus, Aug 09 2014
Formula
a(n) = sum(r=0..n, binomial(n,r)*sum(m=0..r, (sum(j=0..m, binomial(j,-r+n-m-j)*binomial(m,j)))*binomial(r,m))). [Vladimir Kruchinin, Feb 03 2013]
G.f.: 1 + x*G'(x)/G(x) where G(x) is the g.f. of A036766. - Paul D. Hanna, Feb 03 2013
Recurrence: 3*n*(3*n-2)*(3*n-1)*(748*n^3 - 4136*n^2 + 7291*n - 4135)*a(n) = 2*(35156*n^6 - 247126*n^5 + 663756*n^4 - 870079*n^3 + 584710*n^2 - 190393*n + 23280)*a(n-1) + 5*(n-1)*(2244*n^5 - 14652*n^4 + 32367*n^3 - 28501*n^2 + 8564*n - 672)*a(n-2) + 100*(n-2)*(n-1)*(374*n^4 - 1881*n^3 + 2848*n^2 - 1475*n + 222)*a(n-3) + 125*(n-3)*(n-2)*(n-1)*(748*n^3 - 1892*n^2 + 1263*n - 232)*a(n-4). - Vaclav Kotesovec, Feb 11 2015
a(n) ~ c * d^n / sqrt(n), where d = 3.83443724902880556376524112660950145464... is the root of the equation -125-50*d-15*d^2-94*d^3+27*d^4 = 0, c = 0.3404440985692437948910444085315314358395... . - Vaclav Kotesovec, Feb 11 2015
a(n) = Sum_{i=0..n/5} (-1)^i*C(n,i)*C(2*n-5*i-1,n-5*i). - Vladimir Kruchinin, Mar 28 2019
From Peter Bala, Mar 31 2020: (Start)
a(p) == 1 (mod p^2) for any prime p > 5 (follows from Kruchinin's formula above). Cf. A002426. More generally, we may have a(p^k) == a(p^(k-1)) (mod p^(2*k)) for k >= 2 and any prime p.
The sequence b(n) := [x^n] ( F(x)/F(-x) )^n = [x^n] ( F(x)^2/F(x^2) )^n, where F(x) = 1 + x + x^2 + x^3 + x^4, may satisfy the stronger congruences b(p) == 2 (mod p^3) for prime p > 5 (checked up to p = 499). (End)