The sum of ﬁrst $n$ natural numbers $1,2,3,\dots ,n$ is
This formula can be derived by noting that
$$\begin{array}{rcll}{S}_{1}\left(n\right)& =& 1+2+\dots +n& \text{}\\ {S}_{1}\left(n\right)& =& n+\left(n1\right)+\dots +1.& \text{}\end{array}$$Therefore, summing termbyterm,
An alternate way of obtaining the above sum is by using the following two identity:
 (i)
 ${\left(m+1\right)}^{2}{m}^{2}=2m+1$
and, hence,
$$2\sum _{m=1}^{n}m=\sum _{m=1}^{n}\left[{\left(m+1\right)}^{2}{m}^{2}\right]n.$$
 (ii)

$$\begin{array}{rcll}\sum _{m=1}^{n}\left[{\left(m+1\right)}^{2}{m}^{2}\right]& =& \left[{2}^{2}{1}^{2}\right]+\left[{3}^{2}{2}^{2}\right]+\dots +& \text{}\\ & & +\left[{n}^{2}{\left(n1\right)}^{2}\right]+\left[{\left(n+1\right)}^{2}{n}^{2}\right]& \text{}\\ & =& {\left(n+1\right)}^{2}1.& \text{}\end{array}$$
Thus,
More generally, the sum of $k$th power of ﬁrst $n$ natural numbers is denoted as
Since ${a}^{0}=1$, for any $a$, we have ${S}_{0}\left(n\right)=n$. For $k\in \mathbb{N}$, one can compute ${S}_{k}\left(n\right)$ using the identities:
 (i)

$${\left(m+1\right)}^{k+1}{m}^{k+1}=\sum _{i=0}^{k}\left(\genfrac{}{}{0.0pt}{}{k+1}{i}\right){m}^{i}$$
and, hence,
$$\left(k+1\right)\sum _{m=1}^{n}{m}^{k}=\sum _{m=1}^{n}\left[{\left(m+1\right)}^{k+1}{m}^{k+1}\right]\sum _{i=0}^{k1}\sum _{m=1}^{n}\left(\genfrac{}{}{0.0pt}{}{k+1}{i}\right){m}^{i}.$$  (ii)
 ${\sum}_{m=1}^{n}\left[{\left(m+1\right)}^{k+1}{m}^{k+1}\right]={\left(n+1\right)}^{k+1}1$.
Thus,
$$\begin{array}{rcll}\left(k+1\right)\sum _{m=1}^{n}{m}^{k}& =& {\left(n+1\right)}^{k+1}1\sum _{i=0}^{k1}\left(\genfrac{}{}{0.0pt}{}{k+1}{i}\right)\sum _{m=1}^{n}{m}^{i}& \text{}\\ {S}_{k}\left(n\right)& =& \frac{{\left(n+1\right)}^{k+1}}{k+1}\frac{\left(n+1\right)}{k+1}\frac{1}{k+1}\sum _{i=1}^{k1}\left(\genfrac{}{}{0.0pt}{}{k+1}{i}\right){S}_{i}\left(n\right).& \text{}\end{array}$$The formula obtained in RHS is a $\left(k+1\right)$degree polynomial of $n$. Using the above formula, one can compute
$$\begin{array}{rcll}{S}_{2}\left(n\right)& =& \frac{{n}^{3}}{3}+\frac{{n}^{2}}{2}+\frac{n}{6},& \text{}\\ {S}_{3}\left(n\right)& =& \frac{{n}^{4}}{4}+\frac{{n}^{3}}{2}+\frac{{n}^{2}}{4},& \text{}\\ {S}_{4}\left(n\right)& =& \frac{{n}^{5}}{5}+\frac{{n}^{4}}{2}+\frac{{n}^{3}}{3}\frac{n}{30},& \text{}\\ {S}_{5}\left(n\right)& =& \frac{{n}^{6}}{6}+\frac{{n}^{5}}{2}+\frac{5{n}^{4}}{12}\frac{{n}^{2}}{12},& \text{}\\ {S}_{6}\left(n\right)& =& \frac{{n}^{7}}{7}+\frac{{n}^{6}}{2}+\frac{{n}^{5}}{2}\frac{{n}^{3}}{6}+\frac{n}{42},& \text{}\\ {S}_{7}\left(n\right)& =& \frac{{n}^{8}}{8}+\frac{{n}^{7}}{2}+\frac{7{n}^{6}}{12}\frac{7{n}^{4}}{24}+\frac{{n}^{2}}{12},& \text{}\\ \dots & & & \text{}\end{array}$$James/Jacques/Jakob Bernoulli observed that the sum of ﬁrst $n$ whole numbers raised to the $k$th power can be concisely written as,
Note that the coeﬃcients $1,1\u22152,1\u221512,0,\dots $ are independent of $k$. Jakob Bernoulli rewrote the above expression as
$$\begin{array}{rcll}\left(k+1\right){S}_{k}\left(n\right)& =& {n}^{k+1}\frac{1}{2}\left(k+1\right){n}^{k}+\frac{1}{6}\frac{k\left(k+1\right)}{2}{n}^{k1}+0& \text{}\\ & & \frac{1}{30}\frac{\left(k2\right)\left(k1\right)k\left(k+1\right)}{4!}+\dots & \text{}\end{array}$$and, hence,
$${S}_{k}\left(n\right)=\frac{1}{k+1}\sum _{i=0}^{k}\left(\genfrac{}{}{0.0pt}{}{k+1}{i}\right){B}_{i}{n}^{k+1i},$$  (1) 
where ${B}_{i}$ are the $i$th Bernoulli numbers and the formula is called Bernoulli formula. An easier way to grasp the above formula for ${S}_{k}\left(n\right)$ is to rewrite^{1} it as
where $B$ is a notation used to identify the $i$th power of $B$ with the $i$th Bernoulli number ${B}_{i}$ and
This notation also motivates the deﬁnition of Bernoulli polynomial of degree $k$ as
where ${B}_{i}$ are the Bernoulli numbers. In terms of Bernoulli polynomials, the $k$th Bernoulli number ${B}_{k}={B}_{k}\left(0\right)$.
Two quick observation can be made from (1).
 (i)
 There is no constant term in ${S}_{k}\left(n\right)$ because $i$ does not take $k+1$.
 (ii)
 The $k$th Bernoulli number, ${B}_{k}$, is the coeﬃcient of $n$ in ${S}_{k}\left(n\right)$. For instance, ${B}_{0}$ is coeﬃcient of $n$ in ${S}_{0}\left(n\right)=n$ and, hence, ${B}_{0}=1$. Similarly, ${B}_{1}=1\u22152,{B}_{2}=1\u22156,{B}_{3}=0,{B}_{4}=1\u221530,{B}_{5}=0,{B}_{6}=1\u221542,{B}_{7}=0,\dots $.
The beauty about the sequence of Bernoulli numbers is that one can compute them a priori and use it to calculate ${S}_{k}\left(n\right)$, i.e., given $n\in \mathbb{N}$ and $k\in \mathbb{N}\cup \left\{0\right\}$ it is enough to know ${B}_{i}$, for all $0\le i\le k$, to compute ${S}_{k}\left(n\right)$. We already computed ${B}_{0}=1$. Using $n=1$ in the Bernoulli formula (1), we get
$$1=\frac{1}{k+1}\sum _{i=0}^{k}\left(\genfrac{}{}{0.0pt}{}{k+1}{i}\right){B}_{i}$$  (2) 
and, this implies that the $k$th Bernoulli number, for $k>0$, is deﬁned as
Recall that ${B}_{3},{B}_{5},{B}_{7}$ vanish. In fact, it turns out that ${B}_{k}=0$ for all odd $k>1$. The odd indexed Bernoulli numbers vanish because they have no $n$term. Since there are no constant terms in ${S}_{k}\left(n\right)$, the vanishing of Bernoulli numbers is equivalent to the fact that ${n}^{2}$ is a factor of ${S}_{k}\left(n\right)$. Some properties of Bernoulli numbers:
 (i)
 For odd $k>1$, ${B}_{k}=0$.
 (ii)
 For even $k$, ${B}_{k}\ne 0$.
 (iii)
 ${B}_{k}\in \mathbb{Q}$ for all $k\in \mathbb{N}\cup \left\{0\right\}$.
 (iv)
 ${B}_{0}=1$ is the only nonzero integer.
 (v)
 ${B}_{4j}$ is negative rational and ${B}_{4j2}$ is positive rational, for all $j\in \mathbb{N}$.
 (vi)
 ${B}_{6}=1\u221542<\left{B}_{2k}\right$, for all $k\in \mathbb{N}$.
L. Euler gave a nice generating function for the Bernoulli numbers. He seeked a function $f\left(x\right)$ such that ${f}^{\left(k\right)}\left(0\right)={B}_{k}$ where ${f}^{\left(k\right)}$ denotes the $k$th derivative of $f$ with the convention that ${f}^{\left(0\right)}=f$. If such an $f$ exists then it admits the Taylor series expansion, around $0$,
Therefore, for such a function
Recall the Taylor series of ${e}^{x}$,
deﬁned for all $x\in \mathbb{R}$. Consider the product (discrete convolution/Cauchy product) of the inﬁnite series
$$\begin{array}{rcll}f\left(x\right){e}^{x}& =& \left(\sum _{k=0}^{\infty}{B}_{k}\frac{{x}^{k}}{k!}\right)\left(\sum _{k=0}^{\infty}\frac{{x}^{k}}{k!}\right)& \text{}\\ & =& \sum _{k=0}^{\infty}\left(\sum _{i=0}^{k}{B}_{i}\frac{{x}^{i}}{i!}\frac{{x}^{ki}}{\left(ki\right)!}\right)& \text{}\\ & =& \sum _{k=0}^{\infty}\left(\sum _{i=0}^{k}\frac{{B}_{i}}{i!\left(ki\right)!}\right){x}^{k}& \text{}\\ & =& \sum _{k=0}^{\infty}\left(\sum _{i=0}^{k}\left(\genfrac{}{}{0.0pt}{}{k}{i}\right){B}_{i}\right)\frac{{x}^{k}}{k!}.& \text{}\end{array}$$Let
Then
Thus, the $f$ we seek satisﬁes
and is called the generating function. Since ${e}^{x}>0$ for all $x\in \mathbb{R}$, we may rewrite $f\left(x\right)$ as
$$f\left(x\right)=\frac{x}{1{e}^{x}}.$$  (3) 
The entire exercise of seeking $f$ can be generalised to complex numbers and
A word of caution that idenitities (2) and (3) are diﬀerent from the standard formulae because we have derived them for second Bernoulli numbers, viz., with ${B}_{1}=1\u22152$. The standard convention is to work with ﬁrst Bernoulli numbers, viz., with ${B}_{1}=1\u22152$. The ﬁrst Bernoulli numbers can be obtained by following the approach of summing the $k$th powers of ﬁrst $n1$ natural numbers, for any given $n$.
The Bernoulli numbers with appeared while computing ${S}_{k}\left(n\right)$ is appears in many crucial places.
 (a)
 In the expansion of $tanz$.
$$tanz=\sum _{k=1}^{\infty}{\left(1\right)}^{k1}\frac{{2}^{2k}\left({2}^{2k}1\right){B}_{2k}}{2n!}{z}^{2k1}.$$
for all $\leftz\right<\pi \u22152$.
 (b)
 In computing the sum of Riemannzeta function
$$\zeta \left(s\right)=\sum _{n=1}^{\infty}\frac{1}{{n}^{s}}$$
for positive even integers $s$. The case $s=2$ is the famous Basel problem computed by Euler to be ${\pi}^{2}\u22156$.
Theorem 1 (Euler). For all $k\in \mathbb{N}$,
$$\zeta \left(2k\right)={\left(1\right)}^{k+1}\frac{{\left(2\pi \right)}^{2k}}{2\left(2k\right)!}{B}_{2k}.$$Further, the relation $\zeta \left(2k\right)=\frac{{B}_{2k+1}}{2k+1}$ gives the trivial zeroes of the Riemann zeta function.
 (c)
 The Bernoulli numbers were also used as an attempt to prove Fermat’s last
theorem (already discussed in a previous article/blog).
Deﬁnition 1. An odd prime number $p$ is called regular if $p$ does not divide the numerator of ${B}_{k}$, for all even $k\le p3$. Any odd prime which is not regular is called irregular.
The odd primes $3,5,7,\dots ,31$ are all regular primes. The ﬁrst irregular prime is $37$. It is an open question: are there inﬁnitely many regular primes? However, it is known that there are inﬁnitely many irregular primes.