Lucas U-sequence (source code)

= Lucas U-sequence
{c}
{title2=$U_n(P,Q)$}

= U-sequence
{c}
{synonym}

The <Lucas U-sequence> has $U_0(P,Q)=0$, $U_1(P,Q)=1$ and $U_{n+2}=PU_{n+1}-QU_n$. Its first terms are $0,1,P,P^2-Q,P^3-2PQ$. At $(P,Q)=(1,-1)$ it is the <Fibonacci sequence>.

If the roots $\alpha,\beta$ of its <characteristic polynomial of a linear recurrence> are distinct, $U_n=(\alpha^n-\beta^n)/(\alpha-\beta)$. This identity follows by checking the two <initial conditions> and the <linear recurrence relation>. At a repeated root $\alpha=\beta$, the corresponding formula is $U_n=n\alpha^{n-1}$ for $n\ge1$.