grandes-ecoles 2012 QII.C.1

grandes-ecoles · France · centrale-maths2__mp Sequences and Series Algorithmic/Computational Implementation for Sequences and Series
We consider the sequence $x = (x_n)_{n \geqslant 0}$ defined by $$x_0 = 1, \quad x_1 = 1, \quad x_2 = 1, \quad x_3 = 0, \quad \text{and} \quad \forall n \in \mathbb{N}, x_{n+4} = x_{n+3} - 2x_{n+1}$$
In the computer language of your choice (which you will specify), write a procedure (or function) with parameter a natural number $n$ and returning the list (or sequence, or vector) of $x_k$ for $0 \leqslant k \leqslant n$.
We consider the sequence $x = (x_n)_{n \geqslant 0}$ defined by
$$x_0 = 1, \quad x_1 = 1, \quad x_2 = 1, \quad x_3 = 0, \quad \text{and} \quad \forall n \in \mathbb{N}, x_{n+4} = x_{n+3} - 2x_{n+1}$$

In the computer language of your choice (which you will specify), write a procedure (or function) with parameter a natural number $n$ and returning the list (or sequence, or vector) of $x_k$ for $0 \leqslant k \leqslant n$.