淺談伯努利數(Bernoulli Numbers)

伯努利生成函數

伯努利數是指數生成函數的系數:

frac{x}{e^{x}-1}=sum_{k=0}^{infty} frac{B_{k} x^{k}}{k !}\

很自然地我們需要將 dfrac{x}{e^x-1} 級數展開,

begin{align*} f(x) &=frac{x}{e^{x}-1} & text { with } lim _{x rightarrow 0} f(x)&=1 \ f^{prime}(x) &=frac{e^{x} x-e^{x}+1}{left(e^{x}-1right)^{2}} & text { with } lim _{x rightarrow 0} f^{prime}(x)&=-frac{1}{2} \ f^{prime prime}(x) &=frac{e^{2 x} x-e^{x} x-2 e^{2 x}+2 e^{x}}{left(e^{x}-1right)^{3}} & text { with } lim _{x rightarrow 0} f^{prime prime}(x)&=frac{1}{6}\ &vdots &vdots end{align*}\

進而,

begin{aligned} frac{x}{e^{x}-1}&=sum_{n=0}^{infty} frac{f^{(n)} x^{n}}{n !} \ &=1+left(-frac{1}{2}right) x+left(frac{1}{6}right) frac{x^{2}}{2 !}+left(-frac{1}{30}right) frac{x^{4}}{4}+left(frac{1}{42}right) frac{x^{6}}{6 !}+cdots \ &=1-frac{x}{2}+frac{x^{2}}{12}+frac{x^{4}}{720}+frac{x^{6}}{30240}+cdots end{aligned}\

由伯努利生成函數的定義知:

B_n=lim_{xto0}{mathrm{d}^novermathrm{d}x^n}left[xover e^x-1right]\

讓我們計算一下前幾項伯努利數,

begin{array}{lll} B_{0} & =1 & B_{11}&=0 \ B_{1} & =-1 / 2 & B_{12}&=-691 / 2730 \ B_{2} & =1 / 6 & B_{13}&=0 \ B_{3} & =0 & B_{14}&=7 / 6 \ B_{4} & =-1 / 30 & B_{15}&=0 \ B_{5} & =0 & B_{16}&=-3617 / 510 \ B_{6} & =1 / 42 & B_{17}&=0 \ B_{7} & =0 & B_{18}&=43867 / 798 \ B_{8} & =-1 / 30 & cdots \ B_{9} & =0 & B_{49}&=0 \ B_{10} & =5 / 66 & B_{50}&=4950572052410796482122477525 / 66 end{array}\

聰明的你應該能找出一些伯努利數的性質:

  • B_n 是實數
  • 對於 ngeqslant1B_{2n+1}=0
  • B_n 正負交替: B_{4n}<0B_{4n+2}>0 quad(ngeqslant 1)
  • B_{2n} 的量級增長非常快

伯努利數的性質

伯努利數滿足如下關系:

Proof :

begin{aligned} frac{x}{e^{x}-1} &=sum_{i=0}^{infty} frac{B_{i} x^{i}}{i !} \ x &=left(e^{x}-1right) sum_{i=0}^{infty} frac{B_{i} x^{i}}{i !} \ &=left(x+frac{x^{2}}{2 !}+frac{x^{3}}{3 !}+cdotsright) sum_{i=0}^{infty} frac{B_{i} x^{i}}{i !} \ &=sum_{j=1}^{infty} frac{x^{j}}{j !} sum_{i=0}^{infty} frac{B_{i} x^{i}}{i !} \ &=sum_{j=0}^{infty} frac{x^{j+1}}{(j+1) !} sum_{i=0}^{infty} frac{B_{i} x^{i}}{i !} end{aligned}\

回憶一下兩個無窮級數的柯西乘積:

left(sum_{k=0}^{infty} a_{k}right)left(sum_{m=0}^{infty} b_{m}right)=left(sum_{n=0}^{infty} c_{n}right)\

其中

displaystyle c_{n}=a_{0} b_{n}+a_{1} b_{n-1}+cdots+a_{n} b_{0}=sum_{k=0}^{n} a_{k} b_{n-k}\

得到

begin{aligned} x &=sum_{n=0}^{infty} sum_{k=0}^{n} frac{x^{n+1-k}}{(n+1-k) !} cdot frac{B_{k} x^{k}}{k !} \ &=sum_{n=0}^{infty} sum_{k=0}^{n} frac{B_{k} x^{n+1}}{(n+1-k) ! k !} \ &=sum_{n=0}^{infty} sum_{k=0}^{n} frac{(n+1) ! B_{k}}{(n+1-k) ! k !} frac{x^{n+1}}{(n+1) !} \ &=sum_{n=0}^{infty} sum_{k=0}^{n}left(begin{array}{c} n+1 \ k end{array}right) B_{k} frac{x^{n+1}}{(n+1) !}\ &=sum_{n=1}^{infty} sum_{k=0}^{n-1}left(begin{array}{l} n \ k end{array}right) B_{k} frac{x^{n}}{n !} end{aligned}\

對比兩邊 x 的系數即證。

square


B_{0}=1 text { and } sumlimits_{k=0}^{n}binom{n+1}{k}B_{k}=0, text { for } n>1\

也可以表示為

B_{0}=1text { and } B_{n}=-dfrac{1}{n+1}sumlimits_{k=0}^{n-1}binom{n+1}{k}B_{k}, text { for } n>1\

這種形式更能表現出伯努利數彼此之間的基本關系,我們可以通過寫出遞歸的前幾項來證明:

begin{array}{l} 1=B_{0} \ 0=B_{0}+2 B_{1} \ 0=B_{0}+3 B_{1}+3 B_{2} \ 0=B_{0}+4 B_{1}+6 B_{2}+4 B_{3} \ 0=B_{0}+5 B_{1}+10 B_{2}+10 B_{3}+5 B_{4} end{array}\

另外,我們可以借助 (B + 1)^n = B^n 來記憶上面的等式,將左邊二項式展開有:

B^n+binom{n}{n-1}B^{n-1}+cdots+binom{n}{1}B^1+1=B^n\

然後將所有指數轉換為下標:

B_{n}+left(begin{array}{c} n \ n-1 end{array}right) B_{n-1}+cdots+left(begin{array}{c} n \ 1 end{array}right) B_{1}+1=B_{n}\

也即

sum_{k=0}^{n-1}left(begin{array}{l} n \ k end{array}right) B_{k}=0\


Proof 1 :

考慮伯努利生成函數

frac{x}{e^{x}-1}=B_{0}+B_{1} x+frac{B_{2} x^{2}}{2 !}+frac{B_{3} x^{3}}{3 !}+cdots\

begin{aligned} g(x) &=frac{x}{e^{x}-1}-B_{1} x \ &=frac{x}{e^{x}-1}+frac{x}{2} \ &=frac{2 x+xleft(e^{x}-1right)}{2left(e^{x}-1right)} \ &=frac{xleft(e^{x}+1right)}{2left(e^{x}-1right)} \ &=frac{xleft(e^{x}+1right)}{2left(e^{x}-1right)}left(frac{e^{-x / 2}}{e^{-x / 2}}right) \ &=frac{xleft(e^{x / 2}+e^{-x / 2}right)}{2left(e^{x / 2}-e^{-x / 2}right)} end{aligned}\

顯然 g(x) 是偶函數。 因此, dfrac{x}{e^x-1}-B_1x 的冪級數沒有非零奇次冪項,進而結論顯然成立。

square

考慮復函數

f(z)=frac{z}{e^{z}-1}=sumlimits_{n=0}^{infty}B_{n}frac{z^{n}}{n!}\

|z|=1 ,可知 f(z)mathbb{C} 中是解析的,所以下面復函數的Laurent展開式為

frac{f(z)}{z^{2n+2}}=frac{B_{0}}{0!}z^{-2n-2}+frac{B_{1}}{1!}z^{-2n-1}+dots+frac{B_{2n+1}}{(2n+1)!}z^{-1}+frac{B_{2n+2}}{(2n+2)!}+dots\

mathbb{C} 上由留數定理得到

oint_{C}frac{f(z)}{z^{2n+2}},mathrm dz=2pi{i}cdot{frac{B_{2n+1}}{(2n+1)!}}\

z=e^{itheta} ,然後有

begin{align*} B_{2 n+1}&=frac{(2 n+1) !}{2 pi i} int_{0}^{2 pi} frac{e^{i theta}}{e^{e^{i theta}-1}} e^{-2 n i theta-2 i theta} i e^{i theta} ,mathrm d theta\ &=frac{(2 n+1) !}{2 pi} int_{0}^{2 pi} frac{e^{-2 n i theta}}{e^{e^{i theta}-1}} ,mathrm d theta \ &=frac{(2 n+1) !}{2 pi} int_{0}^{pi} frac{e^{-2 n i theta}}{e^{e^{i theta}}-1} ,mathrm d theta+frac{(2 n+1) !}{2 pi} int_{pi}^{2 pi} frac{e^{-2 n i theta}}{e^{e^{i theta}}-1} ,mathrm d theta \ &=frac{(2 n+1) !}{2 pi} int_{0}^{pi} frac{e^{-2 n i theta}}{e^{e^{i theta}}-1} ,mathrm d theta+frac{(2 n+1) !}{2 pi} int_{0}^{pi} frac{e^{-2 n i theta+2 n pi i}}{e^{i theta}-1} ,mathrm d theta \ &=frac{(2n+1)!}{2pi}int_{0}^{pi}frac{e^{-2nitheta}}{e^{e^{itheta}}-1},mathrm dtheta+frac{(2n+1)!}{2pi}int_{0}^{pi}frac{e^{-2nitheta}}{e^{e^{-itheta}}-1},mathrm dtheta\ &=frac{(2n+1)!}{2pi}int_{0}^{pi}-e^{-2nitheta},mathrm dtheta\ &=left{begin{array}{ll} 0, & n geqslant 1 \ -dfrac{1}{2}, & n=0 end{array}right. end{align*}\

square

伯努利數生成器

由伯努利數的定義,可以寫一個伯努利數生成器[1]

from fractions import Fraction as Fr

def bernoulli2():
A, m = [], 0
while True:
A.append(Fr(1, m + 1))
for j in range(m, 0, -1):
A[j - 1] = j * (A[j - 1] - A[j])
yield A[0] # (which is Bm)
m += 1

bn2 = [ix for ix in zip(range(41), bernoulli2())]
bn2 = [(i, b) for i, b in bn2 if b]
width = max(len(str(b.numerator)) for i, b in bn2)
for i, b in bn2:
print('B(%2i) = %*i/%i' % (i, width, b.numerator, b.denominator))

赞(0)