<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\input amstex
\documentstyle{amsppt}
\magnification=1100
\TagsOnRight
\input psfig

\newcount\refno
\define\beginreflist{\let\endreflist=!\refno=0
         \assignrefnumber}
\define\assignrefnumber#1{\ifx#1\endreflist\let\next=\relax
         \else\advance\refno by 1
         \edef#1{\the\refno}\let\next=\assignrefnumber
         \fi\next}

\beginreflist
\Abramowitz
\Graham
\Grassl
\Kaneko
\endreflist

\document
\centerline{\psfig{file=logo116.eps,width=4in}}
\vskip .3in
\centerline{\bf Algorithms for Bernoulli numbers and Euler numbers}
\vskip .3in
\centerline{Kwang-Wu Chen}
\vskip .2in
\centerline{Department of Accounting and Statistics}
\vskip .0in
\centerline{Dahan Institute of Technology}
\vskip .0in
\centerline{P. O. Box 4-27, Hua-Lian 971, Taiwan, Republic of China}
\vskip .2in
\centerline{Email address: kwchen\@ms01.dahan.edu.tw}

\vskip .5in
\centerline{\bf Abstract}
\vskip .2in
In this paper
we investigate some algorithms which produce Bernoulli numbers,
Euler numbers, and tangent numbers. We also 
give closed formulae for Euler numbers and tangent numbers
in terms of Stirling numbers of the second kind.

\vskip .2in
1991 {\it Mathematics Subject Classification}. Primary 11B68
\vskip .1in
{\bf Keywords.}  Bernoulli number, Euler number, Euler polynomial, Stirling number of the second kind, tangent number

 
%=====================================================================================


\head 1. Introduction\endhead

Recently M. Kaneko (ref. \cite\Kaneko)\ reformulated Akiyama and Tanigawa's 
algorithm for computing Bernoulli numbers as follows:

\proclaim{\bf Proposition 1 (ref. \cite\Kaneko)}
Given an initial sequence $a_{0,m}$ ($m=0,1,2,\cdots$), define sequences
$a_{n,m}$ ($n\geq 1$) recursively by 
$$
  a_{n,m}=(m+1)\cdot (a_{n-1,m}-a_{n-1,m+1})\qquad (n\geq 1, m\geq 0).
$$
Then the leading elements
are given by
$$
  a_{n,0}=\sum^n_{m=0}(-1)^m m!{n+1 \brace m+1}a_{0,m},\tag 1
$$
where the Stirling numbers of the second kind ${n \brace m}$ are defined by
$$
  \frac{(e^x-1)^m}{m!}=\sum_{n=m}^\infty{n\brace m}\frac{x^n}{n!}.
$$
\endproclaim

Suppose the initial sequence is $a_{0,m}=1/(m+1)$.
Then the Akiyama and Tanigawa algorithm is the following.
Begin with the $0$-th row $1$, $1/2$, $1/3$, $1/4$, $1/5$, $1/6$, $\cdots$ 
The recursive rule gives the 
first row $1\cdot (1-1/2)$, $2\cdot (1/2-1/3)$, $3\cdot (1/3-1/4)$, 
$4\cdot (1/4-1/5)$, $\cdots$
which is $1/2$, $1/3$, $1/4$, $1/5$, $\cdots$. 
The 2nd row is given by $1\cdot (1/2-1/3)$,
$2\cdot (1/3-1/4)$, $3\cdot (1/4-1/5)$, $\cdots$, etc. 
The Akiyama-Tanigawa matrix $a_{n,m}$ is then
\vskip +.1in
\settabs 11\columns \+1 &amp; 1/2 &amp; 1/3 &amp; 1/4 &amp; 1/5 &amp; 1/6 &amp; 1/7 &amp; 1/8 &amp; 1/9 &amp; 1/10 &amp; 1/11 &amp; ...\cr 
\+1/2 &amp; 1/3 &amp; 1/4 &amp; 1/5 &amp; 1/6 &amp; 1/7 &amp; 1/8 &amp; 1/9 &amp; 1/10 &amp; 1/11 &amp; ... \cr   
\+1/6 &amp; 1/6 &amp; 3/20 &amp; 2/15 &amp; 5/42 &amp; 3/28 &amp; 7/72 &amp; 4/45 &amp; 9/110 &amp; ... \cr
\+0 &amp; 1/30 &amp; 1/20 &amp; 2/35 &amp; 5/84 &amp; 5/84 &amp; 7/120 &amp; 28/495 &amp; ... \cr
\+$-$1/30 &amp; $-$1/30 &amp; $-$3/140 &amp; $-$1/105 &amp; 0 &amp; 1/140 &amp; 49/3960 &amp; ... \cr
\+0 &amp; $-$1/42 &amp; $-$1/28 &amp; $-$4/105 &amp; $-$1/28 &amp; $-$29/924 &amp; ... \cr
\+1/42 &amp; 1/42 &amp; 1/140 &amp; $-$1/105 &amp; $-$5/231 &amp; ...  \cr
\+0 &amp; 1/30 &amp; 1/20 &amp; 8/165 &amp; ...  \cr
\+$-$1/30 &amp; $-$1/30 &amp; 1/220 &amp; ...  \cr
\+0 &amp; $-$5/66 &amp; ... \cr
\+5/66 &amp; ... \cr
\+... \cr
\vskip +.1in

M. Kaneko \cite\Kaneko\ gave a direct proof that the leading element $a_{n,0}$
in the above array is 
$B_n(1)$, where the Bernoulli polynomials $B_n(x)$ are defined by
$$
  \frac{te^{xt}}{e^t-1}=\sum^\infty_{n=0}\frac{B_n(x)t^n}{n!}.
$$
Note that Bernoulli numbers $B_n$ can be defined as $B_n(0)$.

In the sequel we denote the above algorithm as the A-algorithm. 
Let us change the recursive step in the A-algorithm to
$$
  a_{n,m}=m\cdot a_{n-1,m}-(m+1)\cdot a_{n-1,m+1} \qquad (n\geq 1,m\geq 0).
$$
\proclaim{\bf Proposition 2}
Given an initial sequence $a_{0,m}$ $(m=0,1,2,\cdots)$, define the 
sequences $a_{n,m}$ $(n\geq 1)$ recursively by 
$$
  a_{n,m}=m\cdot a_{n-1,m}-(m+1)\cdot a_{n-1,m+1}, \qquad (n\geq 1,m\geq 0).\tag 2
$$
Then
$$
  a_{n,0}=\sum^n_{m=0}(-1)^m m!{n \brace m}a_{0,m}.\tag 3
$$
\endproclaim
We call the algorithm in Proposition 2 the B-algorithm.
If we again start with the initial sequence $a_{0,m}=1/(m+1)$,
then (cf. Eq.~(6.99) or p.~560 of \cite\Graham)
$$
  a_{n,0}=\sum^n_{m=0}\frac{(-1)^mm!{n \brace m}}{m+1}=B_n=B_n(0).
$$

In fact, we have the following theorem:
\proclaim{\bf Theorem 1}
Suppose the
initial sequence $a_{0,m}$ $(m=0,1,2,\cdots)$
has the ordinary generating function 
$$
  A(x)=\sum^\infty_{m=0}a_{0,m}x^m.
$$
Then the leading elements $a_{n,0}$ $(n=0,1,2, \ldots )$ have
exponential generating function
$$
  B(x)=\sum^\infty_{n=0}a_{n,0}\frac{x^n}{n!}
$$
given by $e^x A (1-e^x)$ for the $A$-algorithm and
$A(1-e^x )$ for the $B$-algorithm.
\endproclaim

Consider now the
initial sequence $a_{0,m}=1/2^m$
in the A-algorithm and B-algorithm, respectively. We obtain
the leading elements $a_{n,0}$ as $E_n(1)$ and $E_n(0)$, respectively,
where the Euler polynomials $E_n(x)$ are defined by
$$
  \frac{2e^{xt}}{e^t+1}=\sum^\infty_{n=0}\frac{E_n(x)t^n}{n!}.
$$
Note that the Euler numbers $E_n$ can be defined as $2^nE_n(1/2)$. Alternatively we may
define the Euler numbers by
$$
  \sec x=\sum^\infty_{n=0}\frac{(-1)^nE_{2n}}{(2n)!}x^{2n}.
$$
They are closely related to the tangent numbers $T_n$ (cf. \cite\Grassl),
which are defined by
$$
  \tan x=\sum^\infty_{n=0}\frac{(-1)^{n+1}T_{2n+1}}{(2n+1)!}x^{2n+1},
  \qquad T_0=1.
$$

Moreover, if we take the initial sequence to be
$$
  a_{0,m}=(-1)^{[m/4]}\cdot 2^{-[m/2]}\cdot (1-\delta_{4,m+1}),
  \qquad\text{where }\delta_{4,i}=\cases 1,&amp;\text{if}\quad 4|i,\\
                                        0,&amp;\text{otherwise.}\endcases
$$
in the A-algorithm and B-algorithm, respectively,
the leading elements $a_{n,0}$ become $E_n$ and $T_n$, respectively.
We now give the proof of the
above statements.

\vskip 0.8cm
\head 2. Proof of Proposition 2 and Theorem 1\endhead

To prove Proposition 2, we use a similar trick 
to that used in the proof of Proposition 2 in \cite\Kaneko. Put 
$$
  g_n(t)=\sum^\infty_{m=0}a_{n,m}t^m.
$$
By the recursion Eq.(2) we have for $n\geq 1$
$$
\align
  g_n(t) &amp;= \sum^\infty_{m=0}(m\cdot a_{n-1,m}-(m+1)\cdot a_{n-1,m+1})t^m \\
  &amp;= \sum^\infty_{m=0}(m+1)a_{n-1,m+1}t^{m+1}-\sum^\infty_{m=0}(m+1)a_{n-1,m+1}t^m \\
  &amp;= (t-1)\sum^\infty_{m=0}(m+1)a_{n-1,m+1}t^m \\
  &amp;= (t-1)\frac d{dt}g_{n-1}(t) \ =\ \left((t-1)\frac d{dt}\right)^ng_0(t).
\endalign
$$
Using the recursion for the Stirling numbers of second kind
$$
  {n+1 \brace m+1}=(m+1){n \brace m+1}+{n \brace m},
$$
and mathematical induction on $n$, we have (ref. p.~310 in \cite\Graham)
$$
  \left((t-1)\frac d{dt}\right)^n = \sum^n_{m=0}{n \brace m}(t-1)^m
  \left(\frac d{dt}\right)^m.
$$
Therefore
$$
  g_n(t) = \sum^n_{m=0}{n \brace m}(t-1)^m\left(\frac d{dt}\right)^mg_0(t).
$$
Setting $t=0$ we get the assertion of Proposition 2
$$
  a_{n,0} = \sum^n_{m=0}{n \brace m}(-1)^mm!a_{0,m}.\qed
$$ 

Now we give the proof of Theorem 1.
In the A-algorithm 
we use the identity which appeared in Eq. (3) of \cite\Kaneko:
$$
  \frac{e^x(e^x-1)^m}{m!}=\sum^\infty_{n=m}{n+1 \brace m+1}\frac{x^n}{n!},
$$
and Eq.(1). Then the exponential generating function 
for the leading elements $a_{n,0}$ is
$$
\align
  B(x) = \sum^\infty_{n=0}a_{n,0}\frac{x^n}{n!} 
  &amp;=\sum^\infty_{n=0}\left(\sum^n_{m=0}(-1)^mm!{n+1 \brace m+1}a_{0,m}\right)
       \frac{x^n}{n!} \\
  &amp;= \sum^\infty_{m=0}(-1)^mm!a_{0,m}
                         \sum^\infty_{n=m}{n+1 \brace m+1}\frac{x^n}{n!} \\
  &amp;= \sum^\infty_{m=0}(-1)^mm!a_{0,m}\frac{e^x(e^x-1)^m}{m!} \\
  &amp;= e^x\sum^\infty_{m=0}(1-e^x)^ma_{0,m}\ =\ e^xA(1-e^x).
\endalign
$$

Next we treat the B-algorithm case.
Using Eq.(3) we have
$$
\align
  B(x) = \sum^\infty_{n=0} a_{n,0}\frac{x^n}{n!} 
  &amp;= \sum^\infty_{n=0}\left(\sum^n_{m=0}(-1)^mm!{n \brace m}a_{0,m}\right)
           \frac{x^n}{n!} \\
        &amp;= \sum^\infty_{m=0}(-1)^mm!a_{0,m}\sum^\infty_{n=m}{n \brace m}\frac{x^n}{n!} \\
  &amp;= \sum^\infty_{m=0}(-1)^mm!a_{0,m}\frac{(e^x-1)^m}{m!} \\
  &amp;= \sum^\infty_{m=0}(1-e^x)^ma_{0,m}\ =\ A(1-e^x).
\endalign
$$
This completes the proof of Theorem 1.\qed

%====================================================================================
\vskip 0.8cm
\head 3. Euler numbers and Tangent numbers\endhead

\proclaim{\bf Theorem 2}
Set $a_{0,m}=1/2^m$ for $m\geq 0$ in the A-algorithm and B-algorithm.
Then the leading elements $a_{n,0}$ for $n\geq 0$ are given by $E_n(1)$ 
and $E_n(0)$, respectively.
\endproclaim
\demo{Proof}
In the B-algorithm,
$$
\align
  A(1-e^x) &amp;= \sum^\infty_{m=0}(1-e^x)^ma_{0,m} \\
           &amp;= \sum^\infty_{m=0}\left(\frac{1-e^x}2\right)^m\ =\ \frac2{e^x+1}.
\endalign
$$
The exponential generating functions for $E_n(0)$ and $E_n(1)$ are
$2/(e^x+1)$ and $2e^x/(e^x+1)$, respectively. Using 
Theorem 1 completes the proof. \qed
\enddemo

\proclaim{\bf Theorem 3}
Set 
$$
  a_{0,m}=(-1)^{[m/4]}\cdot 2^{-[m/2]}\cdot (1-\delta_{4,m+1}),
  \qquad\text{where }\delta_{4,i}=\cases 1,&amp;\text{if}\quad 4|i,\\
                                        0,&amp;\text{otherwise,}\endcases
$$
in the A-algorithm and B-algorithm.
Then
the leading elements $a_{n,0}$ are $E_n$ and $T_n$, respectively.
\endproclaim
\demo{Proof}
The exponential generating functions for $E_n$ and $T_n$ are
$2e^x/(e^{2x}+1)$ and $2/(e^{2x}+1)$, respectively.
From the results of Theorem 1, we only need to prove that 
$A(1-e^x)=2/(e^{2x}+1)$ in the B-algorithm.
We have
$$
\align
  A(1-e^x) &amp;= \sum^\infty_{m=0}(1-e^x)^ma_{0,m} \\
  &amp;= \sum^\infty_{k=0}\frac{(-1)^k(1-e^x)^{4k}}{2^{2k}}+
              \sum^\infty_{k=0}\frac{(-1)^k(1-e^x)^{4k+1}}{2^{2k}}+
              \sum^\infty_{k=0}\frac{(-1)^k(1-e^x)^{4k+2}}{2^{2k+1}}. 
\endalign
$$
Let 
$$
  D(x)=\sum^\infty_{k=0}\frac{(-1)^k(1-e^x)^{4k}}{2^{2k}}
      =\frac 4{(e^{2x}-4e^x+5)(e^{2x}+1)}.
$$
Then
$$
\align
  A(1-e^x) &amp;= D(x)+(1-e^x)D(x)+\frac{(1-e^x)^2}{2}D(x) \\
  &amp;= D(x)\cdot (1+1-e^x+\frac{1-2e^x+e^{2x}}{2}) \\
  &amp;= \frac 4{(e^{2x}-4e^x+5)(e^{2x}+1)}\cdot \frac{e^{2x}-4e^x+5}{2} 
  \ =\ \frac{2}{e^{2x}+1}.
\endalign
$$
This completes the proof.\qed
\enddemo

\noindent The following is the matrix generated by Theorem 3 for the Euler numbers $E_n$:
\vskip +.1in
\settabs 12\columns \+1 &amp; 1 &amp; 1/2 &amp; 0 &amp; -1/4 &amp; -1/4 &amp; -1/8 &amp; 0 &amp; 1/16 &amp; 1/16 &amp; 1/32 &amp; ...\cr    
\+0 &amp; 1 &amp; 3/2 &amp; 1 &amp; 0 &amp; -3/4 &amp; -7/8 &amp; -1/2 &amp; 0 &amp; 5/16 &amp; ...\cr  
\+-1 &amp; -1 &amp; 3/2 &amp; 4 &amp; 15/4 &amp; 3/4 &amp; -21/8 &amp; -4 &amp; -45/16 &amp; ...\cr
\+0 &amp; -5 &amp; -15/2 &amp; 1 &amp; 15 &amp; 81/4 &amp; 77/8 &amp; -19/2 &amp; ...\cr 
\+5 &amp; 5 &amp; -51/2 &amp; -56 &amp; -105/4 &amp; 255/4 &amp; 1071/8 &amp; ...\cr
\+0 &amp; 61 &amp; 183/2 &amp; -119 &amp; -450 &amp; -1683/4 &amp; ...\cr
\+-61 &amp; -61 &amp; 1263/2 &amp; 1324 &amp; -585/4 &amp; ...\cr
\+0 &amp; -1385 &amp; -4155/2 &amp; 5881 &amp; ...\cr  
\+1385 &amp; 1385 &amp; -47751/2 &amp; ...\cr
\+0 &amp; 50521 &amp; ...\cr
\+-50521 &amp; ...\cr  
\+...\cr
\vskip +.1in

\noindent The following is the matrix generated by Theorem 3 for the tangent numbers $T_n$:
\vskip +.1in
\settabs 13\columns \+1 &amp; 1 &amp; 1/2 &amp; 0 &amp; -1/4 &amp; -1/4 &amp; -1/8 &amp; 0 
&amp; 1/16 &amp; 1/16 &amp; 1/32 &amp; 0 &amp; ...\cr  
\+-1 &amp; 0 &amp; 1 &amp; 1 &amp; 1/4 &amp; -1/2 &amp; -3/4 &amp; -1/2 &amp; -1/16 &amp; 1/4 &amp; 5/16 &amp; ...\cr
\+0 &amp; -2 &amp; -1 &amp; 2 &amp; 7/2 &amp; 2 &amp; -1 &amp; -3  &amp; -11/4 &amp; -7/8 &amp; ...\cr
\+2 &amp; 0 &amp; -8 &amp; -8 &amp; 4 &amp; 16 &amp; 15 &amp; 1 &amp; -113/8 &amp; ...\cr 
\+0 &amp; 16 &amp; 8 &amp; -40 &amp; -64 &amp; -10 &amp; 83 &amp; 120 &amp; ...\cr  
\+-16 &amp; 0 &amp; 136 &amp; 136 &amp; -206 &amp; -548 &amp; -342 &amp; ...\cr 
\+0 &amp; -272 &amp; -136 &amp; 1232 &amp; 1916 &amp; -688 &amp; ...\cr   
\+272 &amp; 0 &amp; -3968 &amp; -3968 &amp; 11104 &amp; ...\cr
\+0 &amp; 7936 &amp; 3968 &amp; -56320 &amp; ...\cr 
\+-7936 &amp; 0 &amp; 176896 &amp; ...\cr
\+0 &amp; -353792 &amp; ...\cr
\+353792 &amp; ...\cr
\+...\cr
\vskip +.1in

Using Eq.(1) and Eq.(3) in Theorem 2 and 3, we can give closed 
formulae for $E_n(0)$, $E_n(1)$, $E_n$, and $T_n$.
\proclaim{\bf Corollary}
$$
\aligned
  E_n(0) &amp;= \sum^n_{m=0}\frac{(-1)^mm!{n \brace m}}{2^m},\\
  E_n(1) &amp;= \sum^n_{m=0}\frac{(-1)^mm!{n+1 \brace m+1}}{2^m},\qquad
\endaligned
\aligned
  E_n    &amp;= \sum^n_{m=0}(-1)^m m!{n+1 \brace m+1}a_{0,m},\\
  T_n    &amp;= \sum^n_{m=0}(-1)^mm!{n \brace m}a_{0,m},
\endaligned
$$
where $\{a_{0,m}\}^\infty_{m=0}$ is the initial sequence in Theorem 3.
\endproclaim

\proclaim{\bf Remark}
{\rm A referee mentions that the B-algorithm may well yield other notable 
sequences. For instance, the Bell numbers can be obtained from the initial sequence
$(-1)^n/n!$, since their exponential generating function is
$$
  B(x)=A(1-e^x)=\sum^\infty_{m=0}\frac{(e^x-1)^m}{m!}=e^{e^x-1}.
$$
}
\endproclaim

\proclaim{Acknowledgements}
{\rm 
I would like to thank the referee for some useful comments and suggestions.
}
\endproclaim

%===================================================================================

\Refs
\widestnumber\no{10}

\ref
\no \Abramowitz
\by M. Abramowitz and I. A. Stegun
\book Handbook of mathematical functions 
      with formulas, graphs, and mathematical tables
\publ Dover Publications, Inc., New York
\yr 1972
\endref

\ref
\no \Graham
\by R. Graham, D. Knuth, and O. Patashnik
\book Concrete Mathematics
\publ Addison-Wesley
\yr 1989
\endref

\ref
\no \Grassl
\by R. M. Grassl
\paper Euler numbers and skew-hooks
\jour Math. Mag.
\yr 1993
\vol 66
\pages 181--188
\issue 3
\endref

\ref
\no \Kaneko
\by M. Kaneko
\paper The Akiyama-Tanigawa algorithm for Bernoulli numbers
\jour Journal of Integer Sequences
\vol 3
\yr 2000
\pages 1--6
\paperinfo Article 00.2.9
\endref

\endRefs

\bigskip
\hrule

\medskip
\noindent
(Mentions sequences A000110, A000182, A000364, A027641, A027642.)

\medskip
\hrule

\medskip
\noindent
Received April 12, 2001;
revised version received May 15, 2001.
Published in Journal of Integer Sequences, July 13, 2001.

\medskip
\hrule


\enddocument

</pre></body></html>