gives the Bernoulli number .


gives the Bernoulli polynomial .


  • Mathematical function, suitable for both symbolic and numerical manipulation.
  • The Bernoulli polynomials satisfy the generating function relation .
  • The Bernoulli numbers are given by .
  • For odd , the Bernoulli numbers are equal to 0, except .
  • BernoulliB can be evaluated to arbitrary numerical precision.
  • BernoulliB automatically threads over lists.


open allclose all

Basic Examples  (2)

First 10 Bernoulli numbers:

Bernoulli polynomials:

Scope  (3)

BernoulliB threads element-wise over lists:

Plot Bernoulli polynomials:

TraditionalForm formatting:

Applications  (6)

Find sums of powers using BernoulliB:

Compare with direct summation:

Set up an EulerMaclaurin integration formula:

Use it for :

Compare with the exact summation result:

Plot roots of Bernoulli polynomials in the complex plane:

Show the approach of Bernoulli numbers to a limiting form:

The denominator of Bernoulli numbers is given by the von StaudtClausen formula:

Compute Bernoulli numbers in modular arithmetic modulo a prime:

Properties & Relations  (3)

Find BernoulliB numbers from their generating function:

Find BernoulliB polynomials from their generating function:

BernoulliB can be represented as a DifferenceRoot:

Possible Issues  (2)

Algorithmically produced results are frequently expressed using Zeta instead of BernoulliB:

When entered in the traditional form, is not automatically interpreted as a Bernoulli number:

Neat Examples  (2)

Going from Bernoulli numbers to Bernoulli polynomials with umbral calculus:

The 20000^(th) Bernoulli number can be computed in under a second:

Wolfram Research (1988), BernoulliB, Wolfram Language function, (updated 2008).


Wolfram Research (1988), BernoulliB, Wolfram Language function, (updated 2008).


Wolfram Language. 1988. "BernoulliB." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2008.


Wolfram Language. (1988). BernoulliB. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2023_bernoullib, author="Wolfram Research", title="{BernoulliB}", year="2008", howpublished="\url{}", note=[Accessed: 28-November-2023 ]}


@online{reference.wolfram_2023_bernoullib, organization={Wolfram Research}, title={BernoulliB}, year={2008}, url={}, note=[Accessed: 28-November-2023 ]}