
bernoulli - Bernoulli numbers and polynomials

Calling sequence:

bernoulli(n [ , x ])

Parameter:
n  --   non-negative integer
x  --   expression

Summary:

bernoulli(n) returns the n-th Bernoulli number, bernoulli(n,x) the n-th
Bernoulli polynomial in x. If the first argument is not a non-negative integer
then bernoulli returns an error. bernoulli returns the function call with
evaluated arguments, if the first argument cannot be evaluated to a number.

>>  bernoulli(16);

     - 3617/510

>>  bernoulli(3, x); subs(%, x=1/4); bernoulli(3, 1/4);

     x*1/2 + x^2*(-3/2) + x^3

     3/64

     3/64

>>  bernoulli(4, y-1); expand(%);

      (y-1)^2 + (y-1)^3*(-2) + (y-1)^4-1/30

      y*(-12) + y^2*13 + y^3*(-6) + y^4 + 119/30

