Baccalauréat 2024 — Mathematics specialty, Exercices 0 session 2024 — exercise 8 : Recursive sequence, Python and statements (sample paper)
Statement
For each of the following statements, indicate whether it is true or false. Each answer must be justified. An unjustified answer earns no credit.
We consider the sequence $(u_n)$ defined by $u_0=0$ and $u_{n+1}=3u_n+1$ for every natural integer $n$.
1. Consider the function `calcul` written in the Python language, which returns the value of $u_n$:
`def calcul(n):`
` u = 0`
` for i in range(n):`
` u = 3 * u + 1`
` return u`
We also consider the function `liste` written in the Python language:
`def liste(n):`
` l = [ ]`
` for i in range(n):`
` l.append( calcul(i) )`
` return l`
Statement 1: "the call `liste(6)` returns the list `[0, 1, 4, 13, 42, 121]`."
2. Statement 2: "for every natural integer $n$, $u_n=\dfrac{1}{2}\times3^n-\dfrac{1}{2}$."
3. Statement 3: "for every natural integer $n$, $u_{n+1}-u_n$ is a power of 3."
⏳ Solution not generated yet
Open this statement in Expert Maths AI: the step-by-step solution is computed on demand, checked by a second resolution, then published here for everyone.
📝 See the solutionHave a similar exercise? Get it solved step by step, for free.
🧮 Solve my exercise