How to compute quintinomial coefficients?

699 Views Asked by At

I'm looking for a way to compute elements of a quintinomial triangle.

Is there a general case?

To be more specific I'm looking for a way to compute the coefficients of the polynomial $(x^4 + x^3 + x^2 +x + 1)^n $ , $\forall x\in\Bbb R , \forall n \in \Bbb N$ for consecutive values of n.

I'm working on project Euler problem 588.

1

There are 1 best solutions below

0
On

Here is a derivation of an expression which could be implemented. We use the coefficient of operator $[x^p]$ to denote the coefficient of $x^p$ in a series.

We obtain \begin{align*} [x^p]&(x^4+x^3+x^2+x+1)^n\\ &=[x^p]\left(\frac{1-x^5}{1-x}\right)^n\tag{1}\\ &=[x^p](1-x^5)^n\sum_{k=0}^\infty\binom{-n}{k}(-x)^k\tag{2}\\ &=[x^p]\sum_{j=0}^n\binom{n}{j}\left(-x^5\right)^j\sum_{k=0}^\infty\binom{n+k-1}{k}x^k\tag{3}\\ &=\sum_{j=0}^{\min\{n,\lfloor{p/5}\rfloor\}}\binom{n}{j}(-1)^j[x^{p-5j}]\sum_{k=0}^\infty\binom{n+k-1}{k}x^k\tag{4}\\ &=\sum_{j=0}^{\min\{n,\lfloor{p/5}\rfloor\}}(-1)^j\binom{n}{j}\binom{n+p-5j-1}{p-5j}\tag{5} \end{align*}

Comment:

  • In (1) we apply the formula of the finite geometric series.

  • In (2) we apply the binomial series expansion of $(1-x)^{-n}$.

  • In (3) we use the identity $\binom{-p}{q}=\binom{p+q-1}{q}(-1)^q$.

  • In (4) we use the linearity of the coefficient of operator and use the rule $$[x^p]x^qA(x)=[x^{p-q}]A(x)$$ We also restrict the upper limit of the sum, since the exponent of $x^{p-5j}$ has to be non-negative.

  • In (5) we select the coefficient of $x^{p-5j}$.