Bernoulli numbers are a sequence of rational numbers that appear throughout number theory, combinatorics, and analysis. They are usually written as B0, B1, B2, … and can be defined via the generating function
In words, the coefficients in the power series expansion of x / (ex − 1) are the Bernoulli numbers. The first few are
A striking pattern is that all odd-index Bernoulli numbers beyond B1 are zero: B3 = B5 = B7 = … = 0. Non-zero even-index values grow quickly in magnitude and alternate in sign.
Bernoulli numbers are named after Jacob Bernoulli (1655–1705), who studied them while working on formulas for sums of integer powers. For example, to compute
Bernoulli discovered that such sums can be expressed using polynomials in n whose coefficients are built from Bernoulli numbers. Leonhard Euler later extended these ideas and revealed deep links between Bernoulli numbers, special functions, and series expansions.
This calculator computes the Bernoulli number Bn for a given nonnegative integer n using the Akiyama–Tanigawa algorithm. The method constructs a triangular array of rational numbers and reads off Bn from the last entry in the n‑th row.
Conceptually, the algorithm proceeds as follows:
This procedure is numerically efficient for moderate n and well suited to an in-browser implementation.
Bernoulli numbers appear in many fundamental formulas. Some of the most important include:
for n ≥ 1. This ties Bernoulli numbers directly to analytic number theory.
where the coefficients of the resulting polynomial in n involve Bernoulli numbers up to Bp.
The form above is designed to be simple:
In many contexts you only need a few initial values, for example B0 through B10. However, the algorithm can handle considerably larger n before numerical precision or performance become issues.
When you compute Bn, keep the following patterns in mind:
If your result is zero for an odd n ≥ 3, that is expected and reflects a deep symmetry of the generating function. If your result has a large numerator and denominator, that is also normal: Bernoulli numbers quickly become complicated rationals.
Suppose you want to compute B4 using the calculator.
You can verify this value using the generating function. Expanding x / (ex − 1) as a power series gives
Comparing this with the defining expansion
shows that B4/4! = −1/720, so B4 = −1/30, matching the calculator output.
The table below lists several initial Bernoulli numbers and highlights the vanishing of odd indices beyond B1.
| n | Bn | Non-zero? | Sign |
|---|---|---|---|
| 0 | 1 | Yes | Positive |
| 1 | −1/2 | Yes | Negative |
| 2 | 1/6 | Yes | Positive |
| 3 | 0 | No | Zero |
| 4 | −1/30 | Yes | Negative |
| 5 | 0 | No | Zero |
| 6 | 1/42 | Yes | Positive |
| 7 | 0 | No | Zero |
| 8 | −1/30 | Yes | Negative |
| 9 | 0 | No | Zero |
| 10 | 5/66 | Yes | Positive |
Only even indices (plus n = 1) yield non-zero Bernoulli numbers. This pattern is closely related to the symmetry of the generating function x / (ex − 1) around the origin.
Bernoulli numbers are used in many areas:
While the Akiyama–Tanigawa algorithm is efficient, any practical implementation must work within numeric and performance limits. Typical assumptions and constraints include:
For research-grade or very high-index computations, dedicated computer algebra systems or arbitrary-precision libraries are recommended.
Although this page focuses on numerical computation rather than plotting, you can export values and create your own charts in external tools. If you plot Bn against n, you will see an alternating pattern of positive and negative spikes at even indices and zeros at most odd indices. If you instead plot |Bn| on a logarithmic scale, you will notice that the points lie close to a straight line, indicating an almost exponential growth in magnitude.
These visual patterns help explain why only a few Bernoulli numbers significantly contribute to many practical formulas: higher-order terms become very large but are also multiplied by high powers or factorials, so their net effect is controlled.