n-th element of a recursive section with complex roots

62 Views Asked by At

How can I find nth element of a recursive sequence?

$$x_n=x_{n-5} - x_{n-10}$$ $$x_0=...=x_9=1$$

There are complex roots in the characteristic equation :(

2

There are 2 best solutions below

0
On BEST ANSWER

My initial task was to find not n-th element but 2021st. Here's my solution $$x_{2021} = x_{2016} - x_{2011} = x_{2011} - x_{2006} - x_{2011} = \underline{-x_{2006}} = -(x_{2011}-x_{1996})=-(x_{1996}-x_{1991}-x_{1996})=\underline{x_{1991}}=(x_{1986}-x_{1981})=(x_{1981} - x_{1976}-x_{1981}) = \underline{-x_{1976}} = \ldots$$ So the pattern tells us $$x_{2021} = x_{2021-15n} * (-1)^n$$ Max $n$ such that $2021 - 15n > 0$ is $134$. So the answer is: $$x_{11}*(-1)^{134} = (x_6-x_1) = 0$$

Note: Here's the simple C code to check the result:

#include <stdio.h>

int main() {
    int array[2022];
    for (int i = 0; i < 10; i++)
        array[i] = 1;
    for (int i = 10; i < 2022; i++)
        array[i] = array[i-5]-array[i-10];
    printf("%d\n", array[2021]);    
}
0
On

Hint.

Let us try with $a_n = \gamma^n$. After substitution we have $\gamma^n=\gamma^{n-5}-\gamma^{n-10}$ so the recurrence is satisfied if $\gamma^{10}=\gamma^5-1$ then making $\lambda= \gamma^5$ we have equivalently $\lambda^2=\lambda-1$ and then for $\lambda = \frac 12(1\pm i\sqrt{3}) = e^{\pm i\frac{\pi}{3}}$ etc.

NOTE

The recurrence is real so the complex solutions should combine as sinusoidal terms.