 bernoulli - Maple Help

bernoulli

compute Bernoulli numbers and polynomials Calling Sequence bernoulli(n) bernoulli(n, x) bernoulli(n, mode) Parameters

 n - nonnegint; the index of the required Bernoulli number or polynomial x - algebraic; the expression at which the Bernoulli polynomial is evaluated mode - (optional) equation of the form singleton = value, where value is true or false (default: false) Description

 • The bernoulli(n) function computes the nth Bernoulli number. Bernoulli numbers come from the coefficients in the Taylor expansion of x/(e^x - 1).
 • The bernoulli(n, x) function computes the nth Bernoulli polynomial, in the expression x.
 The nth Bernoulli number is defined as bernoulli(n, 0).
 The nth Bernoulli polynomial, ${B}_{n}\left(x\right)$, is defined by the exponential generating function:

$\frac{t{ⅇ}^{xt}}{{ⅇ}^{t}-1}={\sum }_{n=0}^{\mathrm{\infty }}\frac{{B}_{n}\left(x\right){t}^{n}}{n!}$

 • The mode parameter controls whether or not the bernoulli routine computes additional Bernoulli numbers in parallel with the requested one.  For example, if your computer has 4 cores, then the commands bernoulli(1000) and bernoulli(1000, singleton=false) will compute (and store) bernoulli(1002), bernoulli(1004), and bernoulli(1006).  Since in practice nearly all computations which use Bernoulli numbers require many of them, and require them in sequence, this results in considerable efficiency gains.  The commands bernoulli(1000, singleton) and bernoulli(1000, singleton=true) (which are equivalent) will result in only the 1000th Bernoulli number being computed.

The mode option has no effect if your computer has only a single core. Examples

 > $\mathrm{bernoulli}\left(4\right)$
 ${-}\frac{{1}}{{30}}$ (1)
 > $\mathrm{bernoulli}\left(4,0\right)$
 ${-}\frac{{1}}{{30}}$ (2)
 > $\mathrm{bernoulli}\left(4,x\right)$
 ${-}\frac{{1}}{{30}}{+}{{x}}^{{4}}{-}{2}{}{{x}}^{{3}}{+}{{x}}^{{2}}$ (3)
 > $\mathrm{bernoulli}\left(4,\frac{1}{2}\right)$
 $\frac{{7}}{{240}}$ (4)
 > $\mathrm{bernoulli}\left(4,4x\right)$
 ${-}\frac{{1}}{{30}}{+}{256}{}{{x}}^{{4}}{-}{128}{}{{x}}^{{3}}{+}{16}{}{{x}}^{{2}}$ (5)
 > $\mathrm{bernoulli}\left(0,975\right)$
 ${1}$ (6)

The first 15 Bernoulli numbers are listed in the following table. It can be noted that $B$n  = 0_ for all odd $1.

 > $\mathrm{DocumentTools}:-\mathrm{Tabulate}\left(\left[\left[n,\mathrm{seq}\left(1..15\right)\right],\left[\mathrm{B__n},\mathrm{seq}\left(\mathrm{bernoulli}\left(i\right),i=1..15\right)\right]\right],\mathrm{=}\left(\mathrm{fillcolor},\left(T,i,j\right)↦\mathrm{if}\left(\mathrm{type}\left(j,\mathrm{even}\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{and}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}j\ne 2,"LightGrey","White"\right)\right)\right)$
 ${"Tabulate"}$ (7)

 $n$ $1$ $2$ $3$ $4$ $5$ $6$ $7$ $8$ $9$ $10$ $11$ $12$ $13$ $14$ $15$ $\mathrm{B__n}$ $-\frac{1}{2}$ $\frac{1}{6}$ $0$ $-\frac{1}{30}$ $0$ $\frac{1}{42}$ $0$ $-\frac{1}{30}$ $0$ $\frac{5}{66}$ $0$ $-\frac{691}{2730}$ $0$ $\frac{7}{6}$ $0$ Compatibility

 • The mode parameter was introduced in Maple 16.