Bernoulli Numbers and Faulhaber Sums

Exact Bernoulli numbers and sums of powers.

  • Exact up to B(300)
  • Both sign conventions
  • Sums of p-th powers
A round clay table standing on legs made of stacked rounded beads of different heights, with a smooth curved clay ramp across its top, in soft daylight.

The guide

Bernoulli numbers: the sign of one entry and the sums it decides

One list of fractions sits inside every formula for a sum of powers. Only its second entry has two accepted values, and pairing the wrong one with the formula shifts every sum by a whole term.

  • -691/2730 B(12), the same under both sign conventions
  • 385 squares 1 to 10 with B(1) = +1/2; 285 with -1/2
  • 33330 denominator of B(100), 2 x 3 x 5 x 11 x 101
  • 83 digits in the numerator of B(100)
  • 171708332500 1^5 + ... + 100^5, checked by adding
Read the full guide Fold the guide 7 min · 14 sources

Add the first hundred whole numbers and you get 5050. Add their cubes and you get 25,502,500. Add their fifth powers and you get 171708332500. Each total comes from a short polynomial, and the coefficients of every such polynomial come from one shared list of fractions.

That list is the Bernoulli numbers: 1, then a half whose sign depends on the book, then 1/6, zero, -1/30, zero, 1/42, and on. They are easy to state and easy to misquote. Write B(12) as -691/2730 and you are right. Pair the second entry with the wrong form of the formula, or run the sum from the wrong end, and you are off by a whole term without any warning.

Two signs, one disagreement

The Wikipedia article on Bernoulli numbers says two conventions are in use and that they differ only at n = 1. In one, B(1) is minus one half. In the other it is plus one half. The article names the minus form as the one NIST prescribes and many modern textbooks follow. The NIST Digital Library of Mathematical Functions agrees: its table of Bernoulli numbers lists B(1) as minus one half.

Everything else is shared. Every odd index above 1 gives zero. For even indices the signs alternate: the value is negative when n is divisible by 4 and positive otherwise. So B(2) is 1/6, B(4) is -1/30, B(6) is 1/42, B(10) is 5/66 and B(12) is -691/2730, the same under both conventions.

The article also reproduces a 2022 note from Donald Knuth, who wrote that he had come to prefer plus one half. A convention is a choice. What matters is that a calculator says which one it made and that the formula it feeds is matched to it.

The tool built around this essay therefore asks. The default is minus one half, and one switch changes that single entry. Every other row of the table stays the same either way, which the page confirms by running two independent routes to the same numbers and comparing them.

Why sums of powers need them

Faulhaber’s formula writes the sum of the p-th powers of the first n positive integers as a polynomial in n of degree p plus one. The Wikipedia article on it is named for Johann Faulhaber, a mathematician of the early seventeenth century, and says he knew at least the first seventeen cases, though not the pattern behind the coefficients.

MacTutor records that Faulhaber published Academia Algebra in 1631 and gave the sums of the odd powers up to the seventeenth as polynomials in the triangular number n(n+1)/2. He stated that such polynomials exist in general but gave no proof. The Wikipedia article says a rigorous proof had to wait for Carl Jacobi, in 1834.

Jacob Bernoulli’s name is on the numbers because of Ars Conjectandi, published in Basel in 1713, eight years after his death. In it the sum of powers appears under the title Summae Potestatum as a polynomial whose coefficients involve the numbers now called Bernoulli numbers. MacTutor adds that the numbers appear in the book in a discussion of the exponential series.

In the form on the Wikipedia page, the sum of the first n p-th powers is one over p plus one, times the sum over r of C(p+1, r) B(r) n^(p+1-r), with B(1) equal to plus one half. The page notes the other form too, with minus one half. This tool tests what that second form does: with plus one half the formula sums from 1 to n, and with minus one half it sums from 0 to n minus 1. For p above zero that is the same sum missing its last term, n^p.

Take the squares up to 10. With plus one half the formula gives n^3/3 + n^2/2 + n/6, and at n = 10 that is 333 and a third, plus 50, plus one and two thirds: 385. The OEIS entry for the square pyramidal numbers gives the closed form n(n+1)(2n+1)/6, and 10 x 11 x 21 / 6 is also 385. Change the sign and the middle term turns negative: 333 and a third, minus 50, plus one and two thirds is 285. That is 0 squared up to 9 squared. The same slip turns the sum of the first three whole numbers from 6 into 3.

Cubes show the structure at its tidiest. OEIS states that the sum of the first n cubes is the square of the n-th triangular number, so for 100 it is 5050 squared. The formula for p = 3 has only three non-zero terms, n^4/4 + n^3/2 + n^2/4, because B(3) is zero, and at n = 100 they give 25,000,000 plus 500,000 plus 2,500.

What fixes the denominators

The denominators are not arbitrary. The von Staudt-Clausen theorem was found independently by Karl von Staudt and Thomas Clausen in 1840, according to Wikipedia. For even n it says the denominator of B(n) is the product of all primes q for which q - 1 divides n. NIST states the same fact as an integer: B(2n) plus the sum of 1/q over those primes is a whole number.

For n = 12 the divisors are 1, 2, 3, 4, 6 and 12. Adding one to each gives 2, 3, 4, 5, 7 and 13, and dropping the 4, which is not prime, leaves 2, 3, 5, 7 and 13. Their product is 2730, the denominator of -691/2730.

For n = 100 the divisors are 1, 2, 4, 5, 10, 20, 25, 50 and 100. Adding one gives 2, 3, 5, 6, 11, 21, 26, 51 and 101, and the primes among them are 2, 3, 5, 11 and 101. Their product is 33330, which is the denominator of B(100). Its numerator has 83 digits.

Two consequences follow. Every such denominator is square-free and divisible by 6, as the Wikipedia page notes. And a denominator can be predicted from n alone, so a computed value whose denominator breaks the rule is wrong, whatever its numerator looks like.

The same numbers surface in a different place. NIST gives zeta(2n) as (2 pi)^(2n) over 2 (2n)! times the absolute value of B(2n), and lists zeta(2) = pi^2/6, zeta(4) = pi^4/90 and zeta(6) = pi^6/945. Its formula for zeta(-n) as minus B(n+1) over n+1 gives zeta(-1) = -1/12, because B(2) is 1/6. That identity is the only use of the zeta function here, and nothing on the page proves it.

Checking a closed form by adding

A closed form is easy to believe and easy to get wrong. The check is old and plain: add the numbers. The tool does that for every N up to 2,000 and compares the totals. For the tenth powers up to 1,000, the formula gives 91409924241424243424241924242500, and adding all one thousand terms gives the same figure. For p = 5 and N = 100, both give 171,708,332,500.

Those totals are far past what a plain double holds exactly. The MDN page on BigInt uses 9007199254740991, the previous largest safe whole number of the older number type, as its example of digits written exactly as a BigInt. Both the Bernoulli fractions and the sums use big integers, so no digit is rounded.

The Bernoulli values are checked twice. The defining recurrence, the sum over j of C(m+1, j) B(j) equal to zero, runs on whole numbers, and every division in it must leave no remainder. The Akiyama-Tanigawa triangle, described on the Wikipedia page, is a second route. Its first row is 1, 1/2, 1/3, 1/4 and so on, each next entry is (m+1) times the difference of two neighbours above, and the left edge is the Bernoulli numbers with B(1) coming out as plus one half.

The two routes agree at every index except 1, where the triangle gives the plus value and the recurrence gives the minus value. That single disagreement is the whole convention question, seen in numbers.

The method has limits. It covers B(n) up to n = 300, sums with p up to 100 and N up to 10^12, and direct addition only up to N = 2,000. Beyond that a sum rests on the formula, the polynomial check and a comparison with addition at 2,000. It says nothing about Bernoulli polynomials, about error terms when a sum is approximated by an integral, or about why the numbers have these properties. The Wikipedia and NIST pages are the place for those.

The work runs in a background thread. The MDN page on web workers describes this as a way to run laborious processing in a thread separate from the main one, which is why the page stays responsive while three hundred fractions are computed.

So the sign of one entry is a matter of convention, as long as the formula it feeds is matched to it. A page that states B(1), states where the sum starts, and adds up a small case to prove it has done the part that a figure quoted from memory skips.

Sources

Every source consulted for this guide. Links checked November 10, 2026.

  1. Bernoulli number - Wikipedia Wikipedia (CC BY-SA 4.0)
  2. Faulhaber's formula - Wikipedia Wikipedia (CC BY-SA 4.0)
  3. Von Staudt-Clausen theorem - Wikipedia Wikipedia (CC BY-SA 4.0)
  4. DLMF: 24.2 Definitions and Generating Functions NIST Digital Library of Mathematical Functions (US government)
  5. DLMF: 24.10 Arithmetic Properties NIST Digital Library of Mathematical Functions (US government)
  6. DLMF: 25.6 Integer Arguments NIST Digital Library of Mathematical Functions (US government)
  7. A027641 - OEIS The On-Line Encyclopedia of Integer Sequences (CC BY-SA 4.0)
  8. A027642 - OEIS The On-Line Encyclopedia of Integer Sequences (CC BY-SA 4.0)
  9. A000330 - OEIS The On-Line Encyclopedia of Integer Sequences (CC BY-SA 4.0)
  10. A000537 - OEIS The On-Line Encyclopedia of Integer Sequences (CC BY-SA 4.0)
  11. Johann Faulhaber (1580 - 1635) - Biography - MacTutor History of Mathematics MacTutor, University of St Andrews (CC BY-SA 4.0)
  12. Jacob Bernoulli (1655 - 1705) - Biography - MacTutor History of Mathematics MacTutor, University of St Andrews (CC BY-SA 4.0)
  13. BigInt - JavaScript | MDN MDN Web Docs (Creative Commons licence)
  14. Web Workers API - Web APIs | MDN MDN Web Docs (Creative Commons licence)