Bernoulli Numbers Calculator (B_n and Power Sums)

Bernoulli numbers calculator B_n in exact rational form: recurrence, sequence, Faulhaber power sums, zeta(2n) Euler values and von Staudt-Clausen theorem.

Calculation parameters
Was this calculator useful?

The Bernoulli numbers

The Bernoulli numbers B_n, studied by Jakob Bernoulli in the posthumous Ars Conjectandi (1713) and independently by Seki Takakazu in Japan in 1712, form a sequence of rational numbers appearing in mathematical analysis, number theory, topology and theoretical physics. They are defined by the generating series x/(e^x - 1) = Sigma_{n>=0} B_n * x^n / n! and constitute one of the most important sequences in mathematics.

Initial values

B_0 = 1, B_1 = -1/2, B_2 = 1/6, B_3 = 0, B_4 = -1/30, B_5 = 0, B_6 = 1/42, B_7 = 0, B_8 = -1/30, B_9 = 0, B_10 = 5/66, B_12 = -691/2730 (first "large" numerator). All B_n with odd n >= 3 are zero. Modern convention sets B_1 = -1/2; an alternate convention uses B_1 = +1/2.

Recursive formula

The identity Sigma_{j=0}^{n} C(n+1, j) * B_j = 0 for n >= 1 gives the recurrence:

B_n = -(1/(n+1)) * Sigma_{j=0}^{n-1} C(n+1, j) * B_j

With B_0 = 1. The calculator uses this recurrence with exact rational arithmetic (BigInt) to avoid precision loss. At n=60 the numerator already has 23 decimal digits.

Faulhaber's formula for power sums

The sum of the first m k-th powers has polynomial closed form in m:

Sigma_{i=1}^{m} i^k = (1/(k+1)) * Sigma_{j=0}^{k} C(k+1, j) * B_j * m^(k+1-j)

Examples: Sigma i = m(m+1)/2, Sigma i^2 = m(m+1)(2m+1)/6, Sigma i^3 = [m(m+1)/2]^2. The calculator produces the exact BigInt value, avoiding overflow.

Von Staudt-Clausen theorem

The von Staudt-Clausen theorem (1840) characterizes Bernoulli denominators:

B_{2n} + Sigma_{(p-1)|2n, p prime} 1/p is an integer.

So denominator of B_{2n} is the product of primes p such that (p-1) divides 2n. E.g. B_10 has denominator 2*3*11 = 66 (p=2,3,11 with p-1=1,2,10 dividing 10). Fundamental for p-adic theory and Kummer's irregular numbers.

Euler's identity for zeta(2n)

Euler (1735) proved the remarkable formula:

zeta(2n) = Sigma_{k=1}^{infinity} 1/k^(2n) = (-1)^(n+1) * (2pi)^(2n) * B_{2n} / (2 * (2n)!)

So zeta(2) = pi^2/6 (Basel problem), zeta(4) = pi^4/90, zeta(6) = pi^6/945. Values zeta(2n+1) for n >= 1 have no known closed form; zeta(3) (Apery's constant) was proven irrational by Roger Apery in 1978.

The four modes

  1. Single B_n: computes the exact rational number p/q.
  2. Sequence B_0..B_n: full list of the first n+1 Bernoulli numbers.
  3. Power sum: applies Faulhaber's formula for 1^k + 2^k + ... + m^k.
  4. zeta(2n) values: produces closed-form expression in pi^(2n) and B_{2n}.

Applications

  • Number theory: Kummer's regular primes, Fermat's last theorem for regular exponents.
  • Differential topology: Atiyah-Singer theorem, Pontryagin numbers, Todd index.
  • Quantum physics: regularized zero-point energy, Riemann zeta function.
  • Numerical analysis: Euler-Maclaurin summation for quadrature.
  • Combinatorics: bipartite graph enumeration, Stirling numbers of second kind.
  • Analytic number theory: explicit formula for Hurwitz zeta function.

History of the Bernoulli numbers

The numbers are named after Jacob Bernoulli, who introduced them in the posthumous work Ars Conjectandi of 1713 while studying sums of powers of integers. Almost simultaneously, in Japan, the mathematician Seki Takakazu discovered them independently, a rare example of parallel discovery between East and West. But their most famous moment in history came in 1843: Ada Lovelace, annotating Charles Babbage's Analytical Engine, wrote a detailed algorithm to compute the Bernoulli numbers step by step. That algorithm is considered the first computer program ever published, and the Bernoulli numbers were thus the first mathematical object whose automatic computation was designed, a century before electronic computers.

Irregular primes and Fermat's Last Theorem

The Bernoulli numbers have a deep connection with one of the most famous problems in mathematics. In the 19th century Ernst Kummer defined a prime p as "regular" if it divides the numerator of none of the Bernoulli numbers B₂, B₄, …, B_{p−3}, and "irregular" otherwise. Kummer proved that Fermat's Last Theorem holds for all regular prime exponents, a huge step forward when the theorem was still an open conjecture. Irregular primes are relatively rare (the smallest is 37) but infinite, and their distribution is still studied. This unexpected link between power sums, arithmetic of rationals and number theory illustrates the surprising depth of the Bernoulli numbers.

The Euler-Maclaurin formula

One of the most powerful uses of the Bernoulli numbers is the Euler-Maclaurin formula, which links a discrete sum to a continuous integral through a series of correction terms weighted by the Bernoulli numbers. It allows sums to be approximated by integrals (and vice versa) with very high precision, and it underlies numerical methods for evaluating slowly converging series, asymptotic analysis and the famous Stirling approximation for the factorial. The Bernoulli numbers also appear in the series expansions of the tangent and cotangent functions and in the generating function x/(eˣ−1), from which they can be compactly defined. They are thus a central tool of mathematical analysis and scientific computing.

Updated July 2026

Frequently Asked Questions

Why is B_n zero for odd n ≥ 3?

Because the generating function x/(eˣ−1) + x/2 is even, that is symmetric under a sign change of x. An even function has only even powers in its series expansion, so the odd-index coefficients (apart from B₁) vanish. B₁ = −1/2 is the only exception, because it comes from the linear term x/2 added to make the function even. All other B with odd index, from B₃ onward, are exactly zero.

Why do denominators grow so fast?

The von Staudt-Clausen theorem explains the denominator's structure: the denominator of B_n (for even n) is the product of all primes p such that (p−1) divides n. As n grows, more primes satisfy this condition, and the denominator gains new factors. The numerators, meanwhile, grow even faster, almost factorially, making high-index Bernoulli numbers enormous fractions.

What is an irregular prime?

A prime p is called irregular if it divides the numerator of at least one of the Bernoulli numbers B₂, B₄, …, B_{p−3}; it is regular otherwise. The distinction, introduced by Ernst Kummer in the 19th century, is crucial: Kummer proved Fermat's Last Theorem for all regular prime exponents. The smallest irregular prime is 37, and although they are rarer than regular ones, irregular primes have been proved to be infinite.

How to approximate zeta(3) with Bernoulli?

Euler's identity ζ(2n) = (−1)^(n+1)(2π)^(2n)B_{2n}/(2·(2n)!) gives exact closed forms only for even arguments of the zeta function, such as ζ(2)=π²/6 and ζ(4)=π⁴/90. For odd arguments like ζ(3), Apéry's constant, no closed form in terms of π and Bernoulli numbers is known. ζ(3) is instead approximated with other accelerated series or integral representations.

Why B_0 = 1 and not 0?

Because B₀ is the starting value of the recurrence and follows directly from the generating function x/(eˣ−1). Expanding this function as a Taylor series around zero, the constant term equals exactly 1: it is the limit of x/(eˣ−1) as x tends to 0, computable with l'Hôpital's rule. B₀ = 1 is thus the foundation on which the recursive formula builds all subsequent Bernoulli numbers.

How to compute B_n for very large n?

The classic recurrence becomes costly for large n because it requires arithmetic on fractions with enormous integers. Arbitrary-precision arithmetic (BigInt) and more efficient algorithms are therefore used: the method based on the Riemann zeta function computes B_{2n} from a numerical approximation of ζ(2n), exploiting Euler's identity in reverse. Modern mathematical libraries combine these techniques to compute Bernoulli numbers with thousands of digits.

What is the link with the zeta function?

The link is twofold and deep. For positive even integers, ζ(2n) is expressed exactly through B_{2n} and powers of π (Euler's identity of 1735). For negative integers, ζ(−n) = −B_{n+1}/(n+1), which connects the Bernoulli numbers to the values of the zeta at points where the series does not converge, via analytic continuation. This relation is central in analytic number theory and the study of the zeta function.

Who discovered the Bernoulli numbers?

They were introduced by Jacob Bernoulli in the Ars Conjectandi, published posthumously in 1713, while studying power sums. The Japanese mathematician Seki Takakazu discovered them independently at almost the same time. Their most famous historical role, however, is 1843, when Ada Lovelace wrote an algorithm to compute them on Babbage's Analytical Engine: it is considered the first computer program ever published.

Comments (0)

No comments yet. Be the first!