Bernoulli Number Calculator (Compute Bₙ)
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 !)
Thus, Bernoulli numbers are obtained from the coefficients in the power-series expansion of x / (ex − 1). The first few are
- B0 = 1
- B1 = −1/2
- B2 = 1/6
- B3 = 0
- B4 = −1/30
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
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:
- Choose a nonnegative integer n. The recurrence processes rows from 0 through n.
- Initialize an array A of length n + 1.
- For each m from 0 to n, set A[m] = 1 / (m + 1).
- 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]).
- 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:
- Values of the Riemann zeta function at negative integers:
Formula: ζ(− n) = − B^n+1 / (n + 1)
for n ≥ 1. This identity connects the sequence to analytic number theory.
- Euler–Maclaurin summation formula, whose correction terms use Bernoulli numbers to relate a finite sum to an integral.
- Closed forms for sums of powers, such as
Formula: ∑ k = 1 n k^p
where the polynomial coefficients in n involve Bernoulli numbers up to Bp.
How to use: Using the Bernoulli Number Calculator
To calculate a particular Bernoulli number on this page, use the index field as follows:
- Enter a nonnegative integer n in the input field.
- Submit the form to compute Bn.
- 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:
- B0 = 1 and B1 = −1/2 are exceptional starting values.
- For every odd n ≥ 3, Bn = 0.
- Nonzero even-index Bernoulli numbers alternate in sign and grow rapidly in magnitude.
- The sign of B2m for m ≥ 1 follows the alternating pattern used in many asymptotic expansions.
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.
- Set n = 4 in the input field.
- 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 + ⋯
Comparing this with the defining expansion
Formula: ∑ n = 0 ∞ B^n x^n / (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 |
|---|---|---|---|
| 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, 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:
- Summing powers of integers: closed-form expressions for sums like ∑k=1n kp involve Bernoulli numbers up to Bp.
- Approximating sums with integrals: the Euler–Maclaurin formula uses Bernoulli numbers to express discretization corrections in numerical analysis.
- Special functions: derivatives and expansions of trigonometric and hyperbolic functions often have Bernoulli numbers as coefficients.
- Analytic number theory: relations such as ζ(−n) = −Bn+1 / (n + 1) directly connect Bernoulli numbers to the Riemann zeta function.
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:
- Input must be a nonnegative integer. Fractional or negative indices are not accepted by this calculator.
- Maximum index. The page limits n to 300 to avoid floating-point overflow in the browser.
- Displayed representation. Results are shown as decimals, with exponential notation for sufficiently large magnitudes; numerator-and-denominator fractions are not displayed.
- Floating-point precision. Rounding can affect displayed digits, especially as the recurrence’s intermediate values become large.
- Parity shortcut. For odd indices greater than 1, the page returns the mathematically exact value zero directly.
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.
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.
Start the game, then use your pointer or arrow keys to catch the Bernoulli index and avoid irrelevant items.
