46.22 Bernoulli

Bernoulli( n )

Bernoulli returns the n-th Bernoulli number B_n, which is defined by B_0 = 1 and B_n = -sum_{k=0}^{n-1}{{n+1 choose k} B_k}/(n+1).

B_n/n! is the coefficient of x^n in the power series of x/{e^x-1}. Except for B_1=-1/2 the Bernoulli numbers for odd indices m are zero.

    gap> Bernoulli( 4 );
    -1/30
    gap> Bernoulli( 10 );
    5/66
    gap> Bernoulli( 12 );
    -691/2730    # there is no simple pattern in Bernoulli numbers
    gap> Bernoulli( 50 );
    495057205241079648212477525/66    # and they grow fairly fast 

Previous Up Top Next
Index

GAP 3.4.4
April 1997