Sums of powers - numbers, their squares, cubes and the geometric series
Posted on Fri 25 November 2022 in maths
This one is just a simple derivation of some summation formulas. Just in case someone were to prefer this article over wikipedia.
In addition to simply deriving some summation formulas, I will try to give at least a few examples on where these formulas might be useful.
In the end, I will provide a little financial insight into how interest works, which will be based on this.
Sum of the first $n$ natural numbers
The formula for this sum is said to have been discovered by Carl Friedrich Gauss when he was a primary school boy.
As the story goes, his teacher ordered him to add up the numbers $1$ to $100$ as a punishment.
Gauss was able to accomplish this task within a few minutes.
We want to find the sum over the first $n$ positive integers, i. e.:
$$S_1(n) := \sum\limits_{i=1}^n i = 1 + 2 + \cdots + n$$
The slick trick to make this easy is to add up all the numbers twice. That way, we can combine the first and last, the second and second-last, the third and third-last and so on to always get a partial sum of $n+1$:
We can visualize this sum as one of the two triangles above. The red and orange triangle are equal to each other. They are isosceles right triangles with legs of length $n$. Combined, they form a rectangle of dimensions $n \times \left(n+1\right)$.
term 1 | term 2 | $\cdots$ | second-last term | last term | actual sum | |
---|---|---|---|---|---|---|
sum 1 | $1$ | $2$ | $\cdots$ | $n-1$ | $n$ | unknown so far |
sum 2 | $n$ | $n-1$ | $\cdots$ | $2$ | $1$ | unknown so far |
combined sums | $n+1$ | $n+1$ | $\cdots$ | $n+1$ | $n+1$ | $n\cdot \left(n+1\right)$ |
Thus, we obtain
$$2S_1(n) = n\cdot \left(n+1\right)$$
or finally:
$$\boxed{S_1(n) = \frac n2 \left(n+1\right)}$$
More formal derivation
We can also do a more formal calculation, starting from
$$\begin{align} 2 S_1(n) =& S_1(n) + S_1(n)\\ =& \sum\limits_{i=1}^n i + \sum\limits_{j=1}^n j.\\ \end{align}$$
Notice, we used different summation indices for the two sums. This is just to ease differentiation between the sums.
Now, let us substitute
$$k=n+1-j.$$
Doing that, the second sum will change. The $j=1$-term will correspond to $k=n$, $j=2\,\,\Leftrightarrow\,\,k=n-1$ and so on up to $j=n \,\,\Leftrightarrow\,\,k=1$.
This means, that the index $k$ will go over the same range as $j$, just in reverse order. But since the order in a finite sum does not matter, we can simply keep the old range.
Now, we will only have to replace
$$j=n+1-k:$$
$$\begin{align} 2 S_1(n) =& \sum\limits_{i=1}^n i + \sum\limits_{j=1}^n j\\ =& \sum\limits_{i=1}^n i + \sum\limits_{k=1}^n \left(n + 1 - k\right)\\ =& \underbrace{\sum\limits_{i=1}^n i}_{S_1(n)} + \sum\limits_{k=1}^n \left(n + 1\right) - \underbrace{\sum\limits_{k=1}^n k}_{S_1(n)}\\ \end{align}$$
The first and last sum are both exactly equal to each other (and, in fact, to the sum we actually search) and cancel.
The middle term means summing up $n$ times $(n+1)$, because with regard to the summation index $k$, the summand is just a constant:
$$\sum\limits_{k=1}^n \left(n + 1\right) = n\cdot \left(n+1\right)$$
Let us put all of this together.
$$\begin{align} 2 S_1(n) =& \sum\limits_{i=1}^n i + \sum\limits_{k=1}^n \left(n + 1\right) - \sum\limits_{k=1}^n k\\ =& n\cdot \left(n+1\right)\\ S_1(n) =& \frac n2 \cdot \left(n + 1\right)\\ \end{align}$$
That's it.
q.e.d.
Sums over odd and even positive integers
At this point, we can easily obtain the sum of the first $n$ positive odd integers as well as the first $n$ even ones.
Let us start with the even integers. Notice that, for example, $n=4$ means the sum $2 + 4 + 6 + 8$:
$$\begin{align} S_e(n) := & \sum\limits_{i=1}^n 2i\\ = & 2 \sum\limits_{i=1}^n i\\ = & 2 S_0(n)\\ = & n\cdot\left(n+1\right)\\ \end{align}$$
We simply used the fact that constant factors inside a sum (like $2$ in this particular case) can just be pulled outside and in front of the sum.
Now, for the odd ones. $n=4$ will mean $1 + 3 + 5 + 7$, i. e.:
$$\begin{align} S_o(n) := & \sum\limits_{i=1}^n \left(2i - 1 \right)\\ = & \sum\limits_{i=1}^n 2i - \sum\limits_{i=1}^n 1 \\ \end{align}$$
Here, we used the linearity of the sum, i. e. the fact that we can "distribute" the summation operation to individual summands.
The second sum is now just $n \times 1$, which is equal to $n$. The first sum is the sum of the first $n$ even positive integers, which we already know:
$$\begin{align} S_o(n) = & \sum\limits_{i=1}^n 2i - \sum\limits_{i=1}^n 1 \\ = & S_e(n) - n \\ = & n\cdot\left(n+1\right) - n \\ = & n^2 + n - n\\ = & n^2\\ \end{align}$$
That was easy.
As a "bonus", we get the sums of the first $n$ odd or even positive integers right away.
$$\boxed{ \begin{align} S_e(n) = & n\cdot\left(n+1\right)\\ S_o(n) = & n^2\\ \end{align} }$$
Starting with a different summand than $1$
It is now fairly easy to compute the sum
$$S_1(m,n) := \sum\limits_{j=m}^n j = m + (m+1) + \cdots + n.$$
We can rewrite this sum a little bit:
$$\begin{align} S_1(m,n) = & \sum\limits_{j=m}^n j\\ = & \sum\limits_{j=1}^n j - \sum\limits_{k=1}^{m-1} k\\ = & S_1(n) - S_1(m-1)\\ \end{align}$$
Alternatively, we can shift the index, using $j=k+m-1\,\,\Leftrightarrow\,\, k=j-m+1$:
$$\begin{align} S_1(m,n) = & \sum\limits_{j=m}^n j\\ = & \sum\limits_{k=1}^{n-m+1} \left(k+m-1\right)\\ = & \sum\limits_{k=1}^{n-m+1} k + \sum\limits_{k=1}^{n-m+1} \left(m-1\right)\\ = & S_1(n-m+1) + \left(n-m+1\right) \cdot \left(m-1\right)\\ \end{align}$$
So, we obtain:
$$\boxed{S_1(m,n)= S_1(n) - S_1(m-1) = S_1(n-m+1) + \left(n-m+1\right) \cdot \left(m-1\right)}$$
Let us focus on the second equality and do a consistency check. Replacing $m-1\to m^\prime$, we get:
$$\begin{align} S_1(n) - S_1(m-1) =& S_1(n-m+1) + \left(n-m+1\right) \cdot \left(m-1\right)\,\,\,\left.\right|\,m-1 \to m^\prime\\ S_1(n) - S_1(m^\prime) =& S_1(n-m^\prime) + \left(n-m^\prime\right) \cdot m^\prime\,\,\,\left.\right|\,+S_1(m^\prime)\\ S_1(n) =& S_1(m^\prime) + S_1(n-m^\prime) + \left(n-m^\prime\right) \cdot m^\prime\\ =& S_1(m^\prime) + \frac 12 \cdot \left(n-m^\prime\right)\cdot\left(n-m^\prime+1\right) + nm^\prime-{m^\prime}^2\\ =& S_1(m^\prime) + \frac 12 \cdot \left[ n^2 -nm^\prime +n -m^\prime n+{m^\prime}^2 - m^\prime\right] + nm^\prime-{m^\prime}^2\\ =& S_1(m^\prime) + \frac 12 \cdot \left[ n^2 +n - {m^\prime}^2 - m^\prime\right]\\ =& S_1(m^\prime) + \frac 12 \cdot \left[ n\left(n +1\right) - m^\prime\left(m^\prime +1\right)\right]\\ =& S_1(m^\prime) + S_1(n) - S_1(m^\prime)\\ =& S_1(n)\\ \end{align}$$
This is back to where we started, i. e. our calculations were consistent.
Personally, I think it is nice to convince ourselves that all that index shifting really works.
Relationship with arithmetic mean
Let us calculate the expectation value for a die, but a special one.
The die's lowest face should have a value of $m$, the next one $m+1$ and so on up to the highest value of $n$. Of course, every face should be an equally likely result after a throw.
What is the die's expected value $E_D$?
The expected value is defined as sum over every possible outcome $X_i$ times its probability $p_i$:
$$E_D = \sum\limits_i p_i\cdot X_i$$
As stated, all the probabilities should be equal with a fair die. If there are $n^\prime$ possibilities for the result of a throw, $p_i = \frac 1{n^\prime}$. In our case, there are the possibilities
$$\{m,m+1,\ldots, n\},$$
which are $n^\prime=n-m+1$ options.
Thus,
$$\begin{align} E_D =& \frac 1{n-m+1}\sum\limits_{j=m}^n j\\ =& \frac 1{n-m+1}S_1(m,n)\\ =& \frac 1{n-m+1}\left[\frac n2 \left(n+1\right) - \frac m2 \left(m-1\right)\right]\\ =& \frac 12 \cdot \frac {n\cdot \left(n+1\right) - m\cdot \left(m-1\right)}{n-m+1}\\ =& \frac 12 \cdot \frac {n^2+n - m^2+m}{n-m+1}\\ =& \frac 12 \cdot \frac {(n-m)(n+m)+(n+m)}{n-m+1}\\ =& \frac 12 \cdot \frac {(n-m+1)(n+m)}{n-m+1}\\ =& \frac {n+m}{2}.\\ \end{align}$$
So the expected value is the arithmetic mean of the highest and lowest possible value.
Certainly, this is not a suprising result but one that can give us even more confidence in our summation formula.
Sum of squares
Next, we can step it up to the sum over the first $n$ squares:
$$S_2(n) = \sum\limits_{i=1}^n i^2$$
The sum of squares can be visualized as a "tower" of cubes, while at each level of the tower, the cubes are arranged into a square.
At the $i$th level (with $1$ being the "roof" and $n$ being the "ground"), there are $i \times i = i^2$ cubes.
Let us focus on the upmost two levels of the tower, i. e. the level consisting of one cube and the one consisting of $2\times 2 = 4$ cubes. (Still looking at the image.)
This piece can be made into a larger cube of side length $2$ by adding the transparent blue "L-piece".
This "L-piece" is made up of
$$3 = 2^2 - 1^2$$
cubes.
Now, let us add the third layer ($3\times 3 = 9$).
In addition to the blue "L-piece", we need the two green "L-pieces" to make the tower into a full ($3\times 3\times 3$) cube. One of these "L-pieces" consists of
$$5 = 3^2 - 2^2$$
cubes and we need two of them.
So, for each additional level $k$, we need an additional $k-1$ "L-pieces", consisting of $k^2 - \left(k-1\right)^2$ cubes.
Therefore, we can write:
$$S_2(n) + \sum\limits_{j=1}^n \left[ \left(j-1\right)\cdot\left(j^2 -\left(j-1\right)^2\right) \right] = n^3$$
Now, does that help us at all?
Let us do some arithmetic.
$$\begin{align} n^3 = & S_2(n) + \sum\limits_{j=1}^n \left[ \left(j-1\right)\cdot\left(j^2 -\left(j-1\right)^2\right) \right]\\ = & S_2(n) + \sum\limits_{j=1}^n \left[ \left(j-1\right)\cdot\left(j^2 - j^2 + 2 j - 1\right) \right]\\ = & S_2(n) + \sum\limits_{j=1}^n \left[ \left(j-1\right)\cdot\left(2 j - 1\right) \right]\\ = & S_2(n) + \sum\limits_{j=1}^n \left[ 2 j^2 - j -2j + 1\right]\\ = & S_2(n) + \sum\limits_{j=1}^n \left[ 2 j^2 - 3j + 1\right]\\ = & S_2(n) + 2 \underbrace{\sum\limits_{j=1}^n j^2}_{S_2(n)} - 3 \underbrace{\sum\limits_{j=1}^n j}_{S_1(n)} + \underbrace{\sum\limits_{j=1}^n 1}_{n}\\ \end{align}$$
This is nice. We get two other summands of the sum $S_2(n)$, we actually want to figure out and two more sums that we already know.
Thus, we can solve our problem with a little algebra:
$$\begin{align} n^3 = & S_2(n) + 2 \sum\limits_{j=1}^n j^2 - 3 \sum\limits_{j=1}^n j + \sum\limits_{j=1}^n 1\\ = & S_2(n) + 2 S_2(n) - 3 S_1(n) + n\\ = & 3 S_2(n) - \frac 32 n\left(n+1\right) + n\\ 3 S_2(n) = & n^3 + \frac 32 n\left(n+1\right) - n\\ = & n^3 + \frac 32 \left(n^2+n\right) - n\\ = & n^3 + \frac 32 n^2 + \frac 12 n\\ S_2(n) = & \frac 13 n^3 + \frac 12 n^2 + \frac 16 n\\ = & \frac 16 \left(2 n^3 + 3 n^2 + n\right)\\ = & \frac n6 \left(2 n^2 + 3 n + 1\right)\\ \end{align}$$
There we have our formula. However, this derivation was rather intuition-based, so let us prove it by induction.
Proof of the square-sum-formula
We can easily check that our formula works for $n=1$:
$$S_2(1) = 1^2 = 1 \overset{!}{=} \frac 16\left(2+3+1\right)=\frac 16\cdot \left(6\right)=1$$
This means, we have a so-called base case, where our formula is valid.
Now, let us do the induction step. We assume our formula holds for $n$. From there, we derive that it also holds for $n+1$:
From the assumption
$$S_2(n) = \frac n6 \left(2 n^2 + 3 n + 1\right),$$
it follows that
$$S_2(n+1) = \frac {n+1}6 \left[2 (n+1)^2 + 3 (n+1) + 1\right].$$
The induction step can be done using $S_2(n+1) = S_2(n) + \left(n+1\right)^2$ and replacing $S_2(n)$ by our assumption:
$$\begin{align} S_2(n) + (n+1)^2 = & \frac {n+1}6 \left[2 (n^2+ 2n +1) + (3n+3) + 1\right]\\ \frac n6 \left[2 n^2 + 3 n + 1\right] + (n^2 + 2n + 1) = & \frac {n+1}6 \left[2 n^2+ 4n +2 + 3n+3 + 1\right]\\ n \left[2 n^2 + 3 n + 1\right] + 6(n^2 + 2n + 1) = & \left(n+1\right)\cdot \left[2 n^2+ 7n +6\right]\\ 2 n^3 + 3 n^2 + n + 6n^2 + 12n + 6 = & \left[2 n^3+ 7n^2 +6n\right] + \left[2 n^2+ 7n +6\right]\\ 2 n^3 + 9 n^2 + 13n + 6 = & 2 n^3+ 9n^2 +13n+6\\ \end{align}$$
There we have it. Our formula works for $n+1$, if it works for $n$ and vice versa, since everything we used in our derivation were equivalencies.
Now to the critical point. We have demonstrated that our formula works for $n+1$, if it works for $n$.
By our base case, the formula holds for $n=1$ and by induction, it must hold for $n=2$. Since it holds for $n=2$, it must do so for $n=3$. Repeating this argument infinitely, we get our proof for all $n$.
q.e.d.
$$\boxed{S_2(n) = \frac n6 \left(2 n^2 + 3 n + 1\right)}$$
Volume of a pyramid
The square-sum-formula might be used to calculate the volume of a square pyramid.
Suppose we deal with a pyramid that has a square cross-section. The bottom square's area be $A_0=L_0^2$, while its height be $H_0$.
We can fill the pyramid with blocks that have a cuboid-shape with dimensions $l \times l \times h$.
At height $h$, the pyramid has a cross-section of $L(h) \times L(h)$, which can be calculated using the intercept theorem:
$$\begin{align} \frac{L(h)}{L_0} =& \frac{H_0 - h}{H_0}\\ L(h) =& \frac{L_0}{H_0}\cdot\left(H_0 - h\right)\\ \end{align}$$
In order to fit a maximum number of cuboid blocks into the "pyramid slice" between the ground and the height $h$, we should choose $l$ in such a way, that $L(h)$ is an integer multiple of $l$, i. e.:
$$L(h) = n\cdot l$$
With this choice, we can fit $n^2$ cuboids into the lowest slice.
Now, let us make sure, the next "layer" (i. e. between heights $h$ and $2h$) will consist of $(n-1)^2$ cuboids and so on. (Because this way, we can count the cuboids using our formula to get a - possibly crude - approximation for our pyramid's volume.)
To make that happen, we should choose
$$H_0=\left(n+1\right)\cdot h.$$
(The $n+1$-term is, because above the topmost cuboid, there will still be a tiny piece of the pyramid with height $h$, that will not accommodate another cuboid.)
Notice, that this also implies
$$L(0)= L_0 = \left(n+1\right)\cdot l.$$
Moreover, we can also re-arrange for
$$n+1=\frac{H_0}{h}.$$
One cuboid will have a volume of
$$\begin{align} V_C(h)=&l\cdot l\cdot h\\ =&\left(\frac{L_0}{n+1}\right)^2\cdot h\\ =&\left(\frac{L_0}{H_0}h\right)^2\cdot h\\ =& \frac{L_0^2}{H_0^2}h^3\\ \end{align}$$
The pyramid's volume $V_P$ can be approximated by the number of cuboids times the volume of one cuboid:
$$\begin{align} V_P(h) =& S_2(n) \cdot V_C(h)\\ =& \left[S_2(n+1) - \left(n+1\right)^2\right]\cdot V_C(h)\\ =& \left[S_2\left(\frac{H_0}{h}\right) - \left(\frac{H_0}{h}\right)^2\right]\cdot \frac{L_0^2}{H_0^2}h^3\\ =& \left[\frac {\left(\frac{H_0}{h}\right)}6\left[2\left(\frac{H_0}{h}\right)^2+3\left(\frac{H_0}{h}\right)+1\right] - \left(\frac{H_0}{h}\right)^2\right]\cdot \frac{L_0^2}{H_0^2}h^3\\ =& \frac{H_0}{6h}\cdot \frac{L_0^2}{H_0^2}h^3\cdot \left[2\left(\frac{H_0}{h}\right)^2+3\left(\frac{H_0}{h}\right)+1\right] - \left(\frac{H_0}{h}\right)^2\cdot \frac{L_0^2}{H_0^2}h^3\\ =& \frac{1}{6}\cdot \frac{L_0^2}{H_0}h^2\cdot \left[2\frac{H_0^2}{h^2}+3\frac{H_0}{h}+1\right] - L_0^2\cdot h\\ =& 2\cdot \frac{1}{6}\cdot \frac{L_0^2}{H_0}h^2\cdot \frac{H_0^2}{h^2}+3\cdot \frac{1}{6}\cdot \frac{L_0^2}{H_0}h^2\cdot\frac{H_0}{h}+\frac{1}{6}\cdot \frac{L_0^2}{H_0}h^2 - L_0^2\cdot h\\ =& \frac{1}{3}\cdot L_0^2H_0 + \frac{1}{2}\cdot L_0^2h + \frac{1}{6}\cdot \frac{L_0^2}{H_0}h^2 - L_0^2\cdot h\\ =& \frac{1}{3}\cdot L_0^2H_0 - \frac{1}{2}\cdot L_0^2h + \frac{1}{6}\cdot \frac{L_0^2}{H_0}h^2\\ \end{align}$$
What can we do with this?
Well, this is an approximation for the pyramid's volume that really only depends on the height of the cuboids we use to fill it.
It is plausible that the error due to the approximation gets smaller, when we use smaller cuboids, as they would allow us to better fill the space inside the pyramid.
In the limit $h\to 0$, we get the exact result $V_{P,0}$, i. e.:
$$\begin{align} V_{P,0} =& \lim\limits_{h\to 0} V_P(h)\\ =& \lim\limits_{h\to 0} \left(\frac{1}{3}\cdot L_0^2H_0 - \frac{1}{2}\cdot L_0^2h + \frac{1}{6}\cdot \frac{L_0^2}{H_0}h^2\right)\\ \end{align}$$
This limit is decently easy, as we can just drop the second and third summand. We finally arrive at:
$$\boxed{V_{P,0} = \frac{1}{3}\cdot L_0^2H_0 = \frac 13 A_0\cdot H_0}$$
Sadly, I am not aware of any stories of the ancient egyptians using this formula.
Sum of cubes
Next, we want to find a formula for
$$S_3(n) = \sum\limits_{i=1}^n i^3.$$
Unfortunately, there is no easy way to "order" cubes into a higher-dimensional arrangement and use that to visualize some hidden systematic. Picturing four dimensions is, sadly, beyond our abilities.
For starters, let us just play around with this sum a little. We will discover, that the result for $n$ up to $5$ is always a square number:
$n$ | $S_3(n)$ | explicit representation | result as square |
---|---|---|---|
$1$ | $1$ | $1^3$ | $1^2$ |
$2$ | $9$ | $1^3 + 2^3$ | $3^2$ |
$3$ | $36$ | $1^3 + 2^3 + 3^3$ | $6^2$ |
$4$ | $100$ | $1^3 + 2^3 + 3^3 + 4^3$ | $10^2$ |
$5$ | $225$ | $1^3 + 2^3 + 3^3 + 4^3 + 5^3$ | $15^2$ |
This is interesting. We always get squares, but the integers we square are not equidistant. Indeed, they are the regular sum of the first $n$ integers:
$n$ | $\sqrt{S_3(n)}$ | square-root as sum |
---|---|---|
$1$ | $1$ | $1$ |
$2$ | $3$ | $1 + 2$ |
$3$ | $6$ | $1 + 2 + 3$ |
$4$ | $10$ | $1 + 2 + 3 + 4$ |
$5$ | $15$ | $1 + 2 + 3 + 4 + 5$ |
Isn't this amazing? It seems, as if the sum of the first $n$ cubes is just the square of the sum of the first $n$ positive integers:
$$S_3(n) \overset{\mathord{?}}{=} \left[S_1 (n)\right]^2$$
How can we prove this?
Well, we know by trial and error, that this holds for at least up to $n=5$. Therefore, we can now attempt another proof by induction.
Alright. Let us do the induction step from $n$ to $n+1$.
We start with the statement for $n$:
$$\begin{align} S_3(n) = &\left[S_1 (n)\right]^2\\ = &\left[\frac n2 \left(n+1\right)\right]^2\\ = &\frac {n^2}4 \left(n^2+2n+1\right)\\ \end{align}$$
Now, we subtract $n^3$ on both sides:
$$\begin{align} S_3(n)= &\frac {n^2}4 \left(n^2+2n+1\right)\\ S_3(n) - n^3 = &\frac {n^2}4 \left(n^2+2n+1\right) - n^3\\ S_3(n-1) = &\frac {n^2}4 \left(n^2+2n+1\right) - n^3\\ \end{align}$$
It will make our calculations easier to introduce the substitution
$$m := n-1 \,\,\,\Leftrightarrow\,\,\,n =: m+1:$$
$$\begin{align} S_3(n-1) = &\frac {n^2}4 \left(n^2+2n+1\right) - n^3\\ S_3(m) = &\frac {\left(m+1\right)^2}4 \left[\left(m+1\right)^2+2\left(m+1\right)+1\right] - \left(m+1\right)^3\\ =& \frac{m^2+2m+1}{4}\left[m^2+2m+1 +2m +2 +1 \right]- \left(m^3+3m^2+3m+1\right)\\ 4 S_3(m) =& \left(m^2+2m+1\right)\left(m^2+4m+4\right)- 4\left(m^3+3m^2+3m+1\right)\\ =& \left(m^4+4m^3+4m^2\right) + \left(2m^3+8m^2+8m\right) + \left(m^2+4m+4\right) - \left(4m^3+12m^2+12m+4\right)\\ =& m^4 +4m^3 + 4m^2 + 2 m^3 + 8m^2 +8m + m^2 + 4 m + 4 - 4m^3 - 12 m^2 -12 m - 4\\ =& m^4 + 2 m^3 + m^2\\ =& m^2\left(m^2 + 2m + 1\right)\\ S_3(m)=& \frac{m^2}4 \left(m+1\right)^2\\ =& \left[\frac{m}2 \left(m+1\right)\right]^2\\ =& \left[S_1(m)\right]^2\\ \end{align}$$
We are just back to our original formula, except we have a parameter $m$ instead of $n$. Recall, $n=m+1$, by substitution:
$$S_3(n) = \left[S_1(n)\right]^2 \,\,\,\Leftrightarrow\,\,\,S_3(m) = \left[S_1(m)\right]^2$$
Inserting for $n$ yields:
$$S_3(m+1) = \left[S_1(m+1)\right]^2 \,\,\,\Leftrightarrow\,\,\,S_3(m) = \left[S_1(m)\right]^2$$
That is exactly the induction step we wanted!
The equation holding for $m$ is equivalent to it holding for $m+1$. (If you really want to, you can replace $m\to n$, again.)
So now, we have our proof by induction. We have shown that the relation is valid for $n+1$ if it is valid for $n$. And since we have tested by hard for $n$ up to $5$, we have proven or relation for any positive integer $n$.
q.e.d.
$$\boxed{S_3(n) = \left[S_1(n)\right]^2= \left[\frac{n}2\left(n+1\right)\right]^2}$$
The geometric series
While being a little different to the cases before, the geometric series is one of the most important in math:
$$S_g(q,n) = \sum\limits_{i=0}^n q^i$$
Notice the additional parameter $q$.
Once again, a simple trick will help us to resolve the issue.
$$\begin{align} S_g(q,n) =& \sum\limits_{i=0}^n q^i\,\,\left.\right|\cdot q\\ q S_g(q,n) =& \sum\limits_{i=0}^n q^{i+1}\\ \end{align}$$
On the right-hand-side let us do $+1 - 1$ and remove the last term from the sum:
$$\begin{align} q S_g(q,n) =& \sum\limits_{i=0}^n q^{i+1}\\ =& 1 + \sum\limits_{i=0}^{n-1} q^{i+1} -1 + q^{n+1}\\ \end{align}$$
Next, we shift the summation index to $j=i+1$:
$$\begin{align} q S_g(q,n) =& 1 + \sum\limits_{j=1}^{n} q^{j} -1 + q^{n+1}\\ =& \sum\limits_{j=0}^{n} q^{j} -1 + q^{n+1}\\ \end{align}$$
In the last step, we let the sum include the index $j=0$, which will reproduce the $+1$-summand in front of the sum. Now, the sum on the right-hand-side is exactly the geometric series term we are looking for. The rest is once more just algebra:
$$\begin{align} q S_g(q,n) =& \overbrace{\sum\limits_{j=0}^{n} q^{j}}^{S_g(q,n)} -1 + q^{n+1}\\ q S_g(q,n) =& S_g(q,n) -1 + q^{n+1}\\ q S_g(q,n) - S_g(q,n) =& -1 + q^{n+1}\\ \left(q -1\right) S_g(q,n) =& -1 + q^{n+1}\\ S_g(q,n) =& \frac{-1 + q^{n+1}}{q-1}\\ \end{align}$$
Just because it is convention, we multiply numerator and denominator on the right-hand-side by $-1$ to get our final result:
$$\boxed{S_g(q,n) = \frac{1 - q^{n+1}}{1 - q}}$$
Example: geometric series in banking
Suppose you invest an amount of money $C_I$ every year for $a$ years. Your savings plan will offer you an annual interest rate of $p$. (If you had an interest rate of $p\%=1\%$, $p = \frac 1{100}$.)
In the beginning, you invest an amount of $C_I$ and the interest will apply for $a$ years. Then, you invest another $C_I$, which will get interest for $a-1$ years and so on.
In the end, you will have a final amount of money $C_F$, that can be found, using the geometric series:
$$\begin{align} C_F =& C_I \cdot \left(1 +p\right)^a + C_I \cdot \left(1 + p \right)^{a-1} + \cdots + C_I \cdot \left(1+p\right)\\ =& C_I \cdot \sum\limits_{j=1}^a \left(1+p\right)^j\\ =& C_I S_g(1+p,a) -C_I\\ \end{align}$$
Notice, that our summation starts at $j=1$ instead of $j=0$, which is reflective of the fact that you won't do a final investment for $0$ years.
This is why we have to subtract one $C_I$-term in the last step.
$$\begin{align} C_F =& C_I S_g(1+p,a) -C_I\\ =& C_I \left[ S_g(1+p,a) -1 \right]\\ =& C_I \left[\frac{1-(1+p)^{a+1}}{1-(1+p)} -1 \right]\\ =& C_I \frac{1-(1+p)^{a+1}+p}{-p}\\ =& C_I \frac{(1+p)^{a+1}- (1 +p)}{p}\\ \end{align}$$
If you have a "goal", i. e. a certain amount of money $C_F$ that you want to reach, you can now divide both sides of the equation by the fraction and calculate the amount to invest:
$$C_I = C_F \frac{p}{(1+p)^{a+1}- (1 +p)}$$
Try doing this with Excel!
But maybe we can be even more clever. Imagine we don't put a relatively small amount of money into our account every year but instead, we put a big amount of money there right at the beginning.
Since the whole sum would profit from interest over the total runtime instead of just the initial contribution, we can reasonably deduce, that this large amount of money will in the end be smaller than the total investment at an annual fee.
Let the initial large amount of money be $C_O$.
Doing that, you end up with
$$C_F = C_O \left(1+p\right)^a$$
in your bank account. Let us rewrite this a little by defining
$$C_O =: a \cdot C_o,$$
where $C_o$ tells you, how much you had to invest "per year", if you could do it in one single blow at the beginning. This is just helpful for a comparison.
Then,
$$C_I \frac{(1+p)^{a+1}- (1 +p)}{p} = a C_o \left(1+p\right)^a.$$
Now, how many money would you safe?
$$\begin{align} a C_o \left(1+p\right)^a =& C_I \frac{(1+p)^{a+1}- (1 +p)}{p}\\ \frac{C_o}{C_I} =& \frac{(1+p)^{a+1}- (1 +p)}{a \cdot p \left(1+p\right)^a}\\ \end{align}$$
Let us plot this to get a better understanding:
The contour lines correspond to the runtime $a$ of your investment in years. Notice, that they are not all equidistant! From $5$ to $20$, they go in steps of $5$, while from $20$ to $60$, they go in steps of 10 in order to prevent too much cluttering.
On the $x$-axis, we see the interest rate $p\%$, ranging from $0.5\%$ to $10\%$.
The $y$-axis shows the ratio $C_o/C_I$, which is the amount of money you need to invest for a certain goal when you do it in one big initial blow versus the total amount of money you need to invest, when doing it annually over the runtime.
Basically, this is the mere fraction of the original total investment you need to achieve your goal with this strategy.
How can we read this plot?
-
Example 1:
If we have an investment over $a=60$ years at an interest rate of $p\%=10\%$, we only need to invest about $\frac 15$th, if we do it in one blow in the beginning instead of with an annual constant investment.
-
Example 2:
If we invest at an interest rate of $p\%=6\%$ for about $a=6$ years, we could save about $10\%$ of our money.
Unfortunately, interest rates are currently more around $p\%=1\%$ or even less. This means, that even for a long-running investment of $a=60$ years, you can only save about $25\%$ of your money. Thus, this is probably not a good strategy for your personal retirement plan.
What's more, you also cannot save a lot over a relatively short runtime.
So, you really cannot do much with this strategy, if you are not thinking about a relatively small investment over a long period of time, so you could even manage to put all your savings into that investment, right away. (Or you are so rich that you don't have to care, anyway.)
So, you are best early with saving money for your children's retirement plan...
