MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Bernoulli Numbers


Clear[b];

b[0] = 1;

b[n_Integer?Positive] := b[n] = (x /. Solve[
      Sum[Binomial[n + 1, k]*b[k], {k, 0, n - 1}] + (n + 1)*x == 0,
      x][[1]])

And @@ Table[b[n] == BernoulliB[n], {n, 0, 20}]

True

Sum[Binomial[21, k]*b[k], {k, 0, 20}] == 0

True

Table[{n, b[n]}, {n, 0, 20}] // Grid


Bob Hanlon


On Wed, Nov 2, 2011 at 7:22 AM, David Turner <DTurner at faulkner.edu> wrote:
> Hello,
>
> I wish to compute several Bernoulli numbers, say B0 through B20.  The Bernoulli numbers are defined recursively by
>
> B0 = 1, and Solve[Sum[Binomial[n,k]*Bk,{k,0,n-1}]==0,Bn-1] for n > 1
>
> I am trying to compute these numbers in some type of loop, and display them in a table.  Any help is greatly appreciated.
>
> Thanks,
>
> David



  • Prev by Date: Sending an email with a condition be verified
  • Next by Date: Re: Export Spoken Sound (Speak-> .wav file?)
  • Previous by thread: Bernoulli Numbers
  • Next by thread: Re: Bernoulli Numbers