Have you ever tried to compute the sum of the $n$ first $p$ powers?

For instance, we already know that

But what happens with larger values of $p$? Well, the Swiss mathematician Jacob Bernoulli found out a "nearly-closed" formula, using an extremely curious idea. Ready? It all has to do with a magic quantity called $B$

For now, we will assume $B$ is just a plain number, and so will be $a$. According to the binomial expansion,

for $q$ some positive integer. In our case we'll need $q=p+1$, so

and in the same way,

Substracting these two quantities leads to

This is very interesting: if we temporarily forget about the terms having $B$, we have

and this resembles a lot a telescopic sum! That is, the sum $S=1^p+2^p+3^p+\cdots+n^p$ would be nearly straightforward to compute. But the fact is that we cannot forget about the terms having $B$. And there is no quantity $B$ that simultaneously satisfies

so instead, our quantity $B$ will be a magic quantity, such that all previous statements hold

The previous structure containing $a$ and $B$ is very helpful for us to some extent, but after that we will manipulate the quantity $B$. The manipulation will be as follows: after expanding the binomials, the powers of $B$ will be replaced by some other quantities

which will be carefully chosen for everything to work nice. We will denote this trick like this

For instance,

With this trick, we would have

and also

and supposing that we're clever enough to find coefficients $B_m$ for which

then

and also

so that

and finally

Yeah!! Now let's determine these mysterious coefficients $B_m$:

If you think this may be a very important sequence in mathematics, you're right! These are the Bernoulli numbers and are of crucial importance in Number Theory. And yes, odd coefficients other than $B_1$ are zero! Can you see why?

To end with, let's calculate some of these sums! $p=1$:

$p=2$:

$p=3$:

which leads to the well-known identity

$p=4$: