Bernoulli Number Calculator (Compute Bₙ)

JJ Ben-Joseph headshot JJ Ben-Joseph

What are Bernoulli numbers?

Bernoulli numbers are rational coefficients that recur in number theory, combinatorics, and analysis. Written B0, B1, B2, …, they are defined by the generating function

Formula: x / (e^x − 1) = ∑ n = 0 B^n x^n / (n !)

x ex 1 = n=0 Bn xn n!

Thus, Bernoulli numbers are obtained from the coefficients in the power-series expansion of x / (ex − 1). The first few are

A defining pattern of this sequence is that every odd-index Bernoulli number after B1 vanishes: B3 = B5 = B7 = … = 0. The nonzero even-index values alternate in sign and rapidly increase in magnitude.

Historical background of Bernoulli numbers

Bernoulli numbers take their name from Jacob Bernoulli (1655–1705), who encountered them while deriving formulas for sums of integer powers. For example, one such sum is

Formula: ∑ k = 1 n k^2

k=1 n k2

Bernoulli found that power sums can be written as polynomials in n with coefficients involving these numbers. Leonhard Euler later developed related connections to special functions and infinite series.

Introduction: How the Bernoulli Number Calculator works

This Bernoulli Number Calculator evaluates Bn for the nonnegative integer index n with the Akiyama–Tanigawa recurrence. It builds a triangular sequence of floating-point values and takes Bn from the first array entry after the n-th pass.

Conceptually, the Bernoulli recurrence used on this page proceeds as follows:

  1. Choose a nonnegative integer n. The recurrence processes rows from 0 through n.
  2. Initialize an array A of length n + 1.
  3. For each m from 0 to n, set A[m] = 1 / (m + 1).
  4. For each m from 1 to n, update A backwards: for k from m down to 1, replace A[k − 1] with k × (A[k − 1] − A[k]).
  5. After each pass, A[0] is the Bernoulli value for that pass; after the final pass it is Bn.

The calculator also directly returns zero for odd indices greater than 1, which is the established parity property of Bernoulli numbers and avoids unnecessary floating-point work.

Key formulas involving Bernoulli numbers

Bernoulli numbers supply coefficients in several central formulas, including the following:

How to use: Using the Bernoulli Number Calculator

To calculate a particular Bernoulli number on this page, use the index field as follows:

  1. Enter a nonnegative integer n in the input field.
  2. Submit the form to compute Bn.
  3. Read the displayed decimal value and its positive, negative, or zero label. The result can be copied with the Copy Result button.

The calculator displays six decimal places for ordinary-sized results and exponential notation for values with magnitude at least one million. This makes it useful for checking initial values and signs, while exact fractional forms should be obtained from a symbolic or arbitrary-precision tool when they are required.

Interpreting the results of a Bernoulli number calculation

When this calculator reports Bn, the index n provides important context for reading the value:

A zero result at an odd index n ≥ 3 is therefore expected, not a missing calculation. At larger even indices, a decimal output may be very large or use exponential notation; that presentation reflects the growth of the Bernoulli number rather than a change in the definition.

Worked example: calculating the Bernoulli number B4

To find B4 with the Bernoulli Number Calculator, enter 4 as the index n.

  1. Set n = 4 in the input field.
  2. The calculator applies the recurrence and displays B4 as approximately −0.033333, with a negative sign.

The value can be checked from the Bernoulli generating function. Its power-series expansion begins

Formula: x / (e^x − 1) = 1 − x / 2 + x^2 / 12 − x^4 / 720 + ⋯

x ex 1 = 1 x2 + x212 x4720 +

Comparing this with the defining expansion

Formula: ∑ n = 0 ∞ B^n x^n / (n !)

n=0 Bn xn n!

shows that B4/4! = −1/720, so B4 = −1/30. The calculator’s six-place decimal is the displayed approximation of that fraction.

Sample Bernoulli values and parity pattern

This table gives early Bernoulli values and makes the zero pattern at odd indices after 1 explicit.

n Bn Non-zero? Sign
01YesPositive
1−1/2YesNegative
21/6YesPositive
30NoZero
4−1/30YesNegative
50NoZero
61/42YesPositive
70NoZero
8−1/30YesNegative
90NoZero
105/66YesPositive

Only even indices, together with n = 1, produce nonzero Bernoulli numbers. This behavior follows from the symmetry properties of x / (ex − 1) near the origin.

Applications of Bernoulli numbers

Bernoulli numbers matter whenever discrete sums, power series, or special-function expansions need systematic correction coefficients:

Limitations and assumptions of this Bernoulli Number Calculator

This browser calculator evaluates Bernoulli numbers with JavaScript floating-point arithmetic, so its output is intended as a numerical value rather than an exact rational certificate. Its practical constraints are:

For exact high-index Bernoulli fractions, use software that implements arbitrary-precision rational arithmetic and compare its convention for B1 with the generating function shown above.

Visualising Bernoulli numbers

Bernoulli values calculated here can be copied into another program if you want to graph the sequence by index. A plot of Bn against n has zeros at odd indices beyond 1 and alternating positive and negative values at even indices.

Plotting the absolute values of the nonzero even-index terms on a logarithmic scale makes their rapid growth easier to see. In applications such as asymptotic expansions, those large coefficients are paired with other terms, so the size of Bn alone does not determine the size of a final correction.

Enter n to compute.

Status messages will appear here.

Arcade Mini-Game: Bernoulli Number Calculator (Compute Bₙ) Calibration Run

Use this short Bernoulli-number round to identify the valid nonnegative index n and avoid unrelated inputs before calculating Bn.

Score: 0 Timer: 30s Best: 0

Start the game, then use your pointer or arrow keys to catch the Bernoulli index and avoid irrelevant items.