Consider a pyramid with a square base formed of identical balls stacked on top of each other:
- the $1^{\text{st}}$ level, located at the highest level, is composed of 1 ball;
- the $2^{\mathrm{nd}}$ level, just below, is composed of 4 balls;
- the $3^{\mathrm{rd}}$ level has 9 balls;
- the $n$-th level has $n^{2}$ balls.
For any integer $n \geqslant 1$, we denote by $u_{n}$ the number of balls that make up the $n$-th level from the top of the pyramid. Thus, $u_{n} = n^{2}$.
- Calculate the total number of balls in a pyramid with 4 levels.
- Consider the sequence $(S_{n})$ defined for any integer $n \geqslant 1$ by $$S_{n} = u_{1} + u_{2} + \ldots + u_{n}.$$ a. Calculate $S_{5}$ and interpret this result. b. Consider the pyramid function below written incompletely in Python. Copy and complete on your paper the box below so that, for any non-zero natural integer $n$, the instruction \texttt{pyramide(n)} returns the number of balls making up a pyramid with $n$ levels. \begin{verbatim} def pyramide(n) : S = 0 for i in range(1, n+1): S = ... return... \end{verbatim} c. Verify that for any natural integer $n$: $$\frac{n(n+1)(2n+1)}{6} + (n+1)^{2} = \frac{(n+1)(n+2)[2(n+1)+1]}{6}$$ d. Prove by induction that for any integer $n \geqslant 1$: $$S_{n} = \frac{n(n+1)(2n+1)}{6}.$$
- A merchant wishes to arrange oranges in a pyramid with a square base. He has 200 oranges. How many oranges does he use to build the largest possible pyramid?