[Math] the simplest way to get Bernoulli numbers

bernoulli numbers

On paper, what is the simplest way to generate the Bernoulli fractions like $\frac{-1}{30} $and $\frac{7}{6}$?

Basically I'm trying to find and understand $B_n =$ (the stuff on this side) and I've seen something using $i$ and a contour integral with

$$\frac{z}{e^z-1}\frac{ dz}{z^{n+1}}$$

and I don't pretend to understand that at all.

$$B_n=\frac{n!}{2\pi \color{red}{i}}\color{red}{\oint}\color{red}{\frac{z}{\color{black}{e\color{red}{^z}}}}\color{red}{\frac{dz}{\color{black}{e^{n+1}}}}$$

$$B_n=\sum^n_{\color{red}{k}=0}\frac{1}{\color{red}{k}+1}\sum^\color{red}{k}_{\color{red}{v}=0}(-1)^\color{red}{v}\color{red}{\binom{k}{v}}\color{red}{v}^n$$

and then there's this variant I see used a lot called a Generating function where

$$B_n = \sum \frac{1}{k+1} \sum (-1)v (k\dots v)v^n$$

but I don't understand double sums either. I need to be able to reliably get Bernoulli numbers for Taylor series stuff like tangent and the hyperbolic variants. I've reached a limit of my understanding and made clear in red the parts I'm confused about. Like I get that the $i$ is imaginary and somehow related to rotation of $\pi$, probably positive and negative, but I don't know what the $d$ or $z$ mean in that equation.

In the second formula, I don't understand why it switched from $n$ to $k$, then from $k$ to $v$, though I suspect I'm supposed to increment $1:1$ increases in $n$ for $k$, which also increases my increments for $v$ by $1:1$ (creating a $\frac{+1}{-1}$ sequence) but I don't understand the vertical parentheses at all.
I'm not even going to pretend I took a class above calculus 1.

Best Answer

The simplest way to calculate them, using very few fancy tools, is the following recursive definition:

$$B_n=1-\sum_{k=0}^{n-1}{n\choose k}\frac{B_k}{n-k+1}$$ in other words $$B_n=1-{n\choose 0}\frac{B_0}{n-0+1}-{n\choose 1}\frac{B_1}{n-1+1}-\cdots -{n\choose n-1}\frac{B_{n-1}}{n-(n-1)+1}$$

Here, ${a\choose b}$ denotes a binomial coefficient. So, we begin with $B_0=1, B_1=\frac{1}{2}$, and we can calculate $B_2$ using the above recursive definition. That is, $B_2=1-{2\choose 0}\frac{B_0}{3}-{2\choose 1}\frac{B_1}{2}=1-\frac{1}{3}-2\frac{\frac{1}{2}}{2}=\frac{1}{6}$.

Now, with $B_2$ in hand, we can calculate $B_3$. And so on.

Related Question