Padovan polynomials

In mathematics, Padovan polynomials are a generalization of Padovan sequence numbers. These polynomials are defined by:


 * $$P_n(x) = \begin{cases}

1,                    &\mbox{if }n=1\\ 0,                    &\mbox{if }n=2\\ x,                    &\mbox{if }n=3\\ xP_{n-2}(x)+P_{n-3}(x),&\mbox{if } n\ge4. \end{cases}$$

The first few Padovan polynomials are:


 * $$P_1(x)=1 \,$$
 * $$P_2(x)=0 \,$$
 * $$P_3(x)=x \,$$
 * $$P_4(x)=1 \,$$
 * $$P_5(x)=x^2 \,$$
 * $$P_6(x)=2x \,$$
 * $$P_7(x)=x^3+1 \,$$
 * $$P_8(x)=3x^2 \,$$
 * $$P_9(x)=x^4+3x \,$$
 * $$P_{10}(x)=4x^3+1\,$$
 * $$P_{11}(x)=x^5+6x^2.\,$$

The Padovan numbers are recovered by evaluating the polynomials Pn−3(x) at x = 1.

Evaluating Pn−3(x) at x = 2 gives the nth Fibonacci number plus (−1)n.

The ordinary generating function for the sequence is


 * $$ \sum_{n=1}^\infty P_n(x) t^n = \frac{t}{1 - x t^2 - t^3} . $$