!    繝吶Ν繝後�繧､謨ｰ繧呈ｱゅａ繧九�繝ｭ繧ｰ繝ｩ繝�(謾ｹ濶ｯ迚�)
!
!    2013/08/01 譚第ｩ狗ｩｶ逅�渕 譁ｰ隕丈ｽ懈�

program bnum2
implicit none

!integer :: k,l,m       ! 繝ｫ繝ｼ繝怜､画焚
integer :: i           ! 繝吶Ν繝後�繧､謨ｰ豺ｻ蟄�
integer :: j           ! 繝ｫ繝ｼ繝怜､画焚(驛ｨ蛻�柱險育ｮ礼畑)
integer :: kp, lp, mp  ! 髫惹ｹ苓ｨ育ｮ礼畑螟画焚
real(8) :: Cij         ! Combination險育ｮ礼畑螟画焚
real(8) :: sum         ! 驛ｨ蛻�柱繧剃ｿ晏ｭ倥☆繧句､画焚
real(8) :: be(0:1000)  !繝吶Ν繝後�繧､謨ｰ縺ｨ縺励※隕∫ｴ�縺�100縺ゅｋ驟榊�

be(0) = 1.0d0
i = 0

write(*,*) '繝吶Ν繝後�繧､謨ｰ'
write(*,*) i, '蛟狗岼', be(0)

do i = 1, 100
   Cij = 1.0d0

   sum = Cij * be(0)

   do j = 1, i-1
      ! (i+1)C(j)縺ｮ險育ｮ�
      Cij = Cij * dble(i+2-j)/dble(j)

      sum = sum + Cij*be(j)
!      write(*,*) Cij, be(j)
   enddo
!   write(*,*) sum

   be(i) = -1.0d0/dble(i+1)*sum

!   write(*,*) i, '蛟狗岼', be(i)
   write(*,*) i, '&', be(i), '\\ \hline'
enddo

endprogram