Fibonacci sequence but switching between adding and subtracting

109 Views Asked by At

I've been experimenting with the Fibonacci sequence and had the idea to first add than subtract than add than subtract...

So if we start with $1, 1$ we get:

$1, 1, 2, -1, 1, ...$

This sequence is $12$ numbers long(it repeats after that). And I wondered: Why is it $12$? That's my question.

I'm sorry that I ask such a stupid question but I just can't find the answer.

3

There are 3 best solutions below

1
On BEST ANSWER

So if the sequence is $a_n$ you're taking $a_{n} = a_{n-2} + (-1)^n a_{n-1}$. If you start with arbitrary $a_0$ and $a_1$ you'll get $a_6 = -a_0$ and $a_7 = -a_1$, and then $a_{12} = - a_6 = a_0$ and $a_{13} = -a_7 = a_1$, and from there it repeats.

Another way of looking at it is with linear algebra. If $X_n = \pmatrix{a_{n+1}\cr a_{n}}$, for the Fibonacci sequence you have $X_{n+1} = \pmatrix{1 & 1\cr 1 & 0} X_n$. For your sequence you have $X_{n+1} = \pmatrix{1 & 1\cr 1 & 0\cr} X_n$ if $n$ is even and $\pmatrix{-1 & 1\cr 1 & 0\cr} X_n$ if $n$ is odd. Thus when $n$ is even $$X_{n+2} = \pmatrix{-1 & 1\cr 1 & 0\cr}\pmatrix{1 & 1\cr 1 & 0\cr} X_n = \pmatrix{0 & -1\cr 1 & 1\cr} X_n$$ and $\pmatrix{0 & -1\cr 1 & 1}^6 = I$.

1
On

You defined $x_{2n}=x_{2n-2}-x_{2n-1}$ and $x_{2n-1}=x_{2n-2}+x_{2n-3}.$

Therefore $x_{2n}=x_{2n-2}-(x_{2n-2}+x_{2n-3})=-x_{2n-3}$

and $x_{2n-1}=(x_{2n-4}-x_{2n-3})+x_{2n-3}=x_{2n-4}$.

Therefore $x_{2n}= x_{2n-2}-x_{2n-4}$ and $x_{2n-1}=-x_{2n-5}+x_{2n-3};$

i.e., for all $m$, $x_m=x_{m-2}-x_{m-4}$.

This recurrence relation has characteristic root $\lambda$ where $\lambda^4-\lambda^2+1=0$.

Therefore $\lambda^{12}-1=(\lambda^4-\lambda^2+1)(\lambda^4+\lambda^2+1)(\lambda^4-1)=0.$

Therefore the sequence repeats after $12$ terms.

0
On

You can express the relation between successive pairs of values as

$$\begin{cases}a_{n+1}=a_n+b_n,\\b_{n+1}=b_n-a_{n+1}=-a_n.\end{cases}$$

In matrix form,

$$\begin{pmatrix}a_{n+1}\\b_{n+1}\end{pmatrix}= \begin{pmatrix}1&1\\-1&0\end{pmatrix}\begin{pmatrix}a_{n}\\b_{n}\end{pmatrix}.$$

The Eigenvalues of the matrix are $\dfrac{1\pm i\sqrt 3}2$ and they are sixth roots of unity, $e^{\pm i\pi/3}$. This explains why the sequence is periodic, with period $6$ (hence $12$ values in total).

The first powers of the matrix are

$$\begin{pmatrix}1&1\\ -1&0\end{pmatrix},\begin{pmatrix}0&1\\-1&-1\end{pmatrix},\begin{pmatrix}-1&0\\ 0&-1\end{pmatrix},$$ confirming the period $2\times3$.

In the plane $(a,b)$, the iterates form an hexagon.

enter image description here