二阶线性递推通项公式推导

· · 个人记录

对于一个数列 p_i=p_{i-1}+p_{i-2}:

首先,设如下形式:

p_{n+2}-xp_{n+1}=yp_{n+1}-xyp_{n}

则得出:

p_{n+2}=(x+y)p_{n+1}-xyp_n

又有:

p_{n+2}=p_{n+1}+p_n

于是得到:

\begin{aligned} x+y=1\\ xy=-1 \end{aligned} \right.

于是构造一元二次方程,其中两根 t_1=x,t_2=y:

t^2-t-1=0

计算出:

\begin{aligned} x=\frac{1+\sqrt{5}}{2}\\ y=\frac{1-\sqrt{5}}{2} \end{aligned} \right.

推出:

p_{n+2}-\frac{1+\sqrt{5}}{2}p_{n+1}=\frac{1-\sqrt{5}}{2}(p_{n+1}-\frac{1+\sqrt{5}}{2}p_n)

于是事实上:

p_{n+1}-\frac{1+\sqrt{5}}{2}p_{n}=(\frac{1-\sqrt{5}}{2})^{n-1}(p_2-\frac{1+\sqrt{5}}{2}p_1)

变形得到:

p_{n+1}=(\frac{1-\sqrt{5}}{2})^{n-1}(p_2-\frac{1+\sqrt{5}}{2}p_1)+\frac{1+\sqrt{5}}{2}p_{n}

我们再设出以下形式:

p_{n+1}-\lambda(\frac{1-\sqrt{5}}{2})^n=\frac{1+\sqrt{5}}{2}(p_n-\lambda(\frac{1-\sqrt{5}}{2})^{n-1})

解得:

p_{n+1}=\frac{1+\sqrt{5}}{2}p_n-\sqrt{5}\lambda(\frac{1-\sqrt{5}}{2})^{n-1}

于是不难发现:

-\sqrt{5}\lambda(\frac{1-\sqrt{5}}{2})^{n-1}=(\frac{1-\sqrt{5}}{2})^{n-1}(p_2-\frac{1+\sqrt{5}}{2}p_1)

那么:

\lambda=-\frac{p_2-\frac{1+\sqrt{5}}{2}p_1}{\sqrt{5}}=\frac{\frac{\sqrt{5}+5}{2}p_1-\sqrt{5}p_2}{5}

推出:

p_{n+1}-\frac{\frac{\sqrt{5}+5}{2}p_1-\sqrt{5}p_2}{5}(\frac{1-\sqrt{5}}{2})^n=\frac{1+\sqrt{5}}{2}(p_n-\frac{\frac{\sqrt{5}+5}{2}p_1-\sqrt{5}p_2}{5}(\frac{1-\sqrt{5}}{2})^{n-1})

通项公式:

p_{n+1}=\frac{\frac{\sqrt{5}+5}{2}p_1-\sqrt{5}p_2}{5}(\frac{1-\sqrt{5}}{2})^n+(\frac{1+\sqrt{5}}{2})^n(p_1-\frac{\frac{\sqrt{5}+5}{2}p_1-\sqrt{5}p_2}{5}) p_n=(\frac{1-\sqrt{5}}{2})^{n-1}\frac{\frac{5+\sqrt{5}}{2}p_1-\sqrt{5}p_2}{5}+(\frac{1+\sqrt{5}}{2})^{n-1}(\frac{\frac{5-\sqrt{5}}{2}p_1+\sqrt{5}p_2}{5})