This site is supported by donations to The OEIS Foundation.

# Bernoulli numbers

The Bernoulli numbers ${\displaystyle \scriptstyle B_{n},\,n\,\geq \,0,\,}$ rational numbers arising from the Bernoulli polynomials, are (some authors use ${\displaystyle \scriptstyle B_{1}\,=\,{\frac {+1}{2}}\,}$)

${\displaystyle \{{\tfrac {1}{1}},{\tfrac {-1}{2}},{\tfrac {1}{6}},{\tfrac {0}{1}},{\tfrac {-1}{30}},{\tfrac {0}{1}},{\tfrac {1}{42}},{\tfrac {0}{1}},{\tfrac {-1}{30}},{\tfrac {0}{1}},{\tfrac {5}{66}},{\tfrac {0}{1}},{\tfrac {-691}{2730}},{\tfrac {0}{1}},{\tfrac {7}{6}},{\tfrac {0}{1}},{\tfrac {-3617}{510}},{\tfrac {0}{1}},{\tfrac {43867}{798}},{\tfrac {0}{1}},{\tfrac {-174611}{330}},{\tfrac {0}{1}},{\tfrac {854513}{138}},{\tfrac {0}{1}},{\tfrac {-236364091}{2730}},{\tfrac {0}{1}},{\tfrac {8553103}{6}},{\tfrac {0}{1}},{\tfrac {-23749461029}{870}},{\tfrac {0}{1}},\ldots \}\,}$

Numerators of Bernoulli numbers are listed in A027641, denominators in A027642.

The even indexed Bernoulli numbers ${\displaystyle \scriptstyle B_{2n},\,n\,\geq \,0,\,}$ are (some authors write ${\displaystyle \scriptstyle B_{n}\,}$ for ${\displaystyle \scriptstyle B_{2n}\,}$)

${\displaystyle \{{\tfrac {1}{1}},{\tfrac {1}{6}},{\tfrac {-1}{30}},{\tfrac {1}{42}},{\tfrac {-1}{30}},{\tfrac {5}{66}},{\tfrac {-691}{2730}},{\tfrac {7}{6}},{\tfrac {-3617}{510}},{\tfrac {43867}{798}},{\tfrac {-174611}{330}},{\tfrac {854513}{138}},{\tfrac {-236364091}{2730}},{\tfrac {8553103}{6}},{\tfrac {-23749461029}{870}},{\tfrac {8615841276005}{14322}},\ldots \}\,}$

Numerators of even indexed Bernoulli numbers are listed in A000367, denominators in A002445.

The Bernoulli numbers were discovered around the same time by the Swiss mathematician Jakob Bernoulli, after whom they are named, and independently by Japanese mathematician Seki Kōwa. Seki's discovery was posthumously published in 1712 in his work Katsuyo Sampo; Bernoulli's, also posthumously, in his Ars Conjectandi of 1713.

Ada Lovelace's note G on the analytical engine from 1842 describes an algorithm for generating Bernoulli numbers with Charles Babbage's machine. As a result, the Bernoulli numbers have the distinction of being the subject of the first computer program.

## Sum of powers

Closed forms of the sum of powers for fixed values of ${\displaystyle \scriptstyle m\,}$

${\displaystyle S_{m}(n)=\sum _{k=1}^{n}k^{m}=1^{m}+2^{m}+\cdots +n^{m}\,}$

are always polynomials in ${\displaystyle \scriptstyle n\,}$ of degree ${\displaystyle \scriptstyle m+1\,}$, called Bernoulli polynomials. Note that ${\displaystyle \scriptstyle S_{m}(0)\,=\,0\,}$ for all ${\displaystyle \scriptstyle m\,\geq \,0\,}$ since in this case the sum is the empty sum.

The coefficients of these polynomials are related to the Bernoulli numbers by Bernoulli's formula

${\displaystyle S_{m}(n)={\frac {1}{m+1}}\sum _{k=0}^{m}{\binom {m+1}{k}}B_{k}\,n^{m+1-k},\,}$

where ${\displaystyle \scriptstyle B_{1}\,=\,{\frac {+1}{2}}\,}$ (instead of ${\displaystyle \scriptstyle B_{1}\,=\,{\frac {-1}{2}}\,}$).

Some authors state Bernoulli's formula in a different way

${\displaystyle S_{m}(n)={\frac {1}{m+1}}\sum _{k=0}^{m}(-1)^{k}\,{\binom {m+1}{k}}\,B_{k}\,n^{m+1-k},\,}$

where ${\displaystyle \scriptstyle B_{1}\,=\,{\frac {-1}{2}}\,}$.

Let ${\displaystyle \scriptstyle n\,\geq \,0\,}$. Taking ${\displaystyle \scriptstyle m\,}$ to be 0 and ${\displaystyle \scriptstyle B_{0}\,=\,1\,}$ gives the natural numbers {0, 1, 2, 3, ...} (A001477).

${\displaystyle 1+1+\cdots +1={\frac {1}{1}}\left(B_{0}\,n\right)=n.\,}$

Taking ${\displaystyle \scriptstyle m\,}$ to be 1 and ${\displaystyle \scriptstyle B_{1}\,=\,{\frac {+1}{2}}\,}$ (instead of ${\displaystyle \scriptstyle B_{1}\,=\,{\frac {-1}{2}}\,}$) gives the triangular numbers {0, 1, 3, 6, ...} (A000217).

${\displaystyle 1+2+\cdots +n={\frac {1}{2}}\left(B_{0}\,n^{2}+2\,B_{1}n^{1}\right)={\frac {1}{2}}\left(n^{2}+n\right).\,}$

Taking ${\displaystyle \scriptstyle m\,}$ to be 2 and ${\displaystyle \scriptstyle B_{2}\,=\,{\frac {1}{6}}\,}$ gives the square pyramidal numbers {0, 1, 5, 14, ...} (A000330).

${\displaystyle 1^{2}+2^{2}+\cdots +n^{2}={\frac {1}{3}}\left(B_{0}\,n^{3}+3\,B_{1}n^{2}+3\,B_{2}n^{1}\right)={\frac {1}{3}}\left(n^{3}+{\frac {3}{2}}\,n^{2}+{\frac {1}{2}}\,n\right).\,}$

Bernoulli's formula is sometimes called Faulhaber's formula after Johann Faulhaber who also found remarkable ways to calculate sum of powers.

Faulhaber's formula was generalized by V. Guo and J. Zeng to a q-analog (Guo & Zeng 2005).

### Sum of powers triangle

${\displaystyle a(m,0):=1,\,a(m,m):=m!,\quad m\geq 0;}$
${\displaystyle a(m,n):=n\,a(m-1,n-1)+(n+1)\,a(m-1,n),\quad 0
 ${\displaystyle \scriptstyle m\,}$ = 0 1 1 1 1 2 1 3 2 3 1 7 12 6 4 1 15 50 60 24 5 1 31 180 390 360 120 6 1 63 602 2100 3360 2520 720 7 1 127 1932 10206 25200 31920 20160 5040 8 1 255 6050 46620 166824 317520 332640 181440 40320 9 1 511 ? ? ? ? ? ? ? 362880 10 1 1023 ? ? ? ? ? ? ? ? 3628800
${\displaystyle \sum _{k=0}^{n-1}{\binom {n}{k+1}}\,a(m,k)=S_{m}(n)=\sum _{k=1}^{n}k^{m},\quad m\geq 0,\quad 0\leq n\leq m.\,}$

Examples:

C(3, 1) * a(5, 0) + C(3, 2) * a(5, 1) + C(3, 3) * a(5, 2) = 3 * 1 + 3 * 31 + 1 * 180 = 276
S_5(3) = 1^5 + 2^5 + 3^5 = 276

C(4, 1) * a(5, 0) + C(4, 2) * a(5, 1) + C(4, 3) * a(5, 2) + C(4, 4) * a(5, 3) = 4 * 1 + 6 * 31 + 4 * 180 + 1 * 390 = 1300
S_5(4) = 1^5 + 2^5 + 3^5 + 4^5 = 1300

A028246 Triangular array of numbers a(n,k) = (1/k) * Sum_{i=0..k} (-1)^(k-i) * C(k,i) * i^n; n >= 1, 1 <= k <= n.

{1, 1, 1, 1, 3, 2, 1, 7, 12, 6, 1, 15, 50, 60, 24, 1, 31, 180, 390, 360, 120, 1, 63, 602, 2100, 3360, 2520, 720, 1, 127, 1932, 10206, 25200, 31920, 20160, 5040, ...}

## Generating function

### Exponential generating function

The exponential generating function for the Bernoulli numbers is

${\displaystyle E_{\{B_{n}\}}(x)={\frac {x}{e^{x}-1}}=\sum _{n=0}^{\infty }{\frac {B_{n}\,x^{n}}{n!}}\,}$

## Asymptotic approximation

For even ${\displaystyle \scriptstyle n\,}$ the Bernoulli numbers can be approximated by

${\displaystyle |B_{n}|\sim 2{\sqrt {2\pi n}}\left({\frac {n}{2\pi e}}\right)^{n}\left({\frac {120n^{2}+9}{120n^{2}-1}}\right)^{n}.\,}$

This formula (Peter Luschny, 2007) is based on the well known connection of the Bernoulli numbers with the Riemann zeta function and on an approximation of the factorial function given by Gergő Nemes[1] in 2007 (A181855/A181856). For example this approximation gives

${\displaystyle |B(1000)|\approx 0.5318704469415522033\ldots \times 10^{1770}\,}$

which is off only by three units in the least significant digit displayed.

This formula is an improvement over a standard asymptotic formula for the even Bernoulli numbers (see DLMF/NIST[2])

${\displaystyle |B_{n}|\sim 2{\sqrt {2\pi n}}\left({\frac {n}{2\pi e}}\right)^{n}.\,}$

## Sequences

A027641 Numerators of Bernoulli numbers ${\displaystyle \scriptstyle B_{n},\,n\,\geq \,0\,}$.

{1, –1, 1, 0, –1, 0, 1, 0, –1, 0, 5, 0, –691, 0, 7, 0, –3617, 0, 43867, 0, –174611, 0, 854513, 0, –236364091, 0, 8553103, 0, –23749461029, 0, 8615841276005, 0, –7709321041217, ...}

A027642 Denominators of Bernoulli numbers ${\displaystyle \scriptstyle B_{n},\,n\,\geq \,0\,}$.

{1, 2, 6, 1, 30, 1, 42, 1, 30, 1, 66, 1, 2730, 1, 6, 1, 510, 1, 798, 1, 330, 1, 138, 1, 2730, 1, 6, 1, 870, 1, 14322, 1, 510, 1, 6, 1, 1919190, 1, 6, 1, 13530, 1, 1806, 1, 690, ...}

A000367 Numerators of even indexed Bernoulli numbers ${\displaystyle \scriptstyle B_{2n},\,n\,\geq \,0\,}$.

{1, 1, –1, 1, –1, 5, –691, 7, –3617, 43867, –174611, 854513, –236364091, 8553103, –23749461029, 8615841276005, –7709321041217, 2577687858367, –26315271553053477373, ...}

A002445 Denominators of even indexed Bernoulli numbers ${\displaystyle \scriptstyle B_{2n},\,n\,\geq \,0\,}$.

{1, 6, 30, 42, 30, 66, 2730, 6, 510, 798, 330, 138, 2730, 6, 870, 14322, 510, 6, 1919190, 6, 13530, 1806, 690, 282, 46410, 66, 1590, 798, 870, 354, 56786730, 6, 510, 64722, 30, ...}

A?????? Numerators of odd indexed Bernoulli numbers ${\displaystyle \scriptstyle B_{2n+1},\,n\,\geq \,0\,}$.

{–1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...}

A054977 Denominators of odd indexed Bernoulli numbers ${\displaystyle \scriptstyle B_{2n+1},\,n\,\geq \,0\,}$.

{2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...}