Algorithmic/Computational Implementation for Sequences and Series

The question asks to write code (e.g., Python, CAS) to compute terms of a sequence, partial sums, or polynomial expressions related to a series.

bac-s-maths 2020 Q4 (non-specialty) View
We consider the sequence $\left( u _ { n } \right)$ defined, for all non-zero natural integers $n$, by:
$$u _ { n } = \frac { n ( n + 2 ) } { ( n + 1 ) ^ { 2 } }$$
The sequence $( v _ { n } )$ is defined by: $v _ { 1 } = u _ { 1 }$, $v _ { 2 } = u _ { 1 } \times u _ { 2 }$ and for all natural integers $n \geqslant 3$, $v _ { n } = u _ { 1 } \times u _ { 2 } \times \ldots \times u _ { n } = v _ { n - 1 } \times u _ { n }$.
  1. Verify that we have $v _ { 2 } = \frac { 2 } { 3 }$ then calculate $v _ { 3 }$.
  2. We consider the incomplete algorithm below. Copy and complete this algorithm on your paper so that, after its execution, the variable $V$ contains the value $v _ { n }$ where $n$ is a non-zero natural integer defined by the user. No justification is required.
    Algorithm
    1.$V \leftarrow 1$
    2.For $i$ varying from 1 to $n$
    3.$U \leftarrow \frac { \ldots ( \ldots + 2 ) } { ( \ldots + 1 ) ^ { 2 } }$
    4.$V \leftarrow \ldots$
    5.End For

  3. a. Show that, for all non-zero natural integers $n$, $u _ { n } = 1 - \frac { 1 } { ( n + 1 ) ^ { 2 } }$. b. Show that, for all non-zero natural integers $n$, $0 < u _ { n } < 1$.
  4. a. Show that the sequence $( v _ { n } )$ is decreasing. b. Justify that the sequence $( v _ { n } )$ is convergent (we do not ask to calculate its limit).
  5. a. Verify that, for all non-zero natural integers $n$, $v _ { n + 1 } = v _ { n } \times \frac { ( n + 1 ) ( n + 3 ) } { ( n + 2 ) ^ { 2 } }$. b. Show by induction that, for all non-zero natural integers $n$, $v _ { n } = \frac { n + 2 } { 2 ( n + 1 ) }$. c. Determine the limit of the sequence $\left( v _ { n } \right)$.
  6. We consider the sequence $w _ { n }$ defined by $w _ { 1 } = \ln \left( u _ { 1 } \right)$, $w _ { 2 } = \ln \left( u _ { 1 } \right) + \ln \left( u _ { 2 } \right)$ and, for all natural integers $n \geqslant 3$, by $$w _ { n } = \sum _ { k = 1 } ^ { n } \ln \left( u _ { k } \right) = \ln \left( u _ { 1 } \right) + \ln \left( u _ { 2 } \right) + \ldots + \ln \left( u _ { n } \right)$$ Show that $w _ { 7 } = 2 w _ { 1 }$.
gaokao 2019 Q9 5 marks View
Executing the flowchart on the right, if the input $\varepsilon$ is 0.01, then the output value of $s$ equals
A. $2 - \frac { 1 } { 2 ^ { 4 } }$
B. $2 - \frac { 1 } { 2 ^ { 5 } }$
C. $2 - \frac { 1 } { 2 ^ { 6 } }$
D. $2 - \frac { 1 } { 2 ^ { 7 } }$
grandes-ecoles 2012 QII.C.1 View
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$.
grandes-ecoles 2013 QII.E.3 View
We approximate $\varphi _ { n } ( x )$ using partial sums
$$S _ { m } = \sum _ { p = 0 } ^ { m } ( - 1 ) ^ { p } a _ { p } \quad \text { with } \quad m \in \mathbb { N } \quad \text { and } \quad a _ { p } = \frac { 1 } { p ! ( n + p ) ! } \left( \frac { x } { 2 } \right) ^ { n + 2 p }$$
Write a Maple or Mathematica function, CalculPhi, with arguments $(n, x, \varepsilon)$ returning an approximate value of $\varphi _ { n } ( x )$ to within $\varepsilon$. The coefficients $a _ { p }$ will be calculated by recursion.
grandes-ecoles 2019 Q48 View
For $j \in \mathbb{N}$, we denote by $Y_{n,j}$ the set of partitions whose first term $\alpha_1$ is less than or equal to $j$ and by $y_{n,j}$ the cardinality of $Y_{n,j}$; we set $y_{0,0} = 1$.
Write a Python function that takes as argument an integer $n \geqslant 1$ and returns $y_{n,n}$.