%I #93 Aug 03 2024 16:44:37
%S 1,1,1,1,2,2,2,4,5,5,5,10,14,16,16,16,32,46,56,61,61,61,122,178,224,
%T 256,272,272,272,544,800,1024,1202,1324,1385,1385,1385,2770,4094,5296,
%U 6320,7120,7664,7936,7936,7936,15872,23536,30656,36976,42272,46366,49136,50521,50521
%N Triangle of Euler-Bernoulli or Entringer numbers read by rows: T(n,k) is the number of down-up permutations of n+1 starting with k+1.
%D R. C. Entringer, A combinatorial interpretation of the Euler and Bernoulli numbers, Nieuw Archief voor Wiskunde, 14 (1966), 241-246.
%H Reinhard Zumkeller, <a href="/A008282/b008282.txt">Rows n=1..120 of triangle, flattened</a>
%H V. I. Arnold, <a href="http://mi.mathnet.ru/eng/umn4470">The calculus of snakes and the combinatorics of Bernoulli, Euler and Springer numbers of Coxeter groups</a>, Uspekhi Mat. nauk., 47 (#1, 1992), 3-45 = Russian Math. Surveys, Vol. 47 (1992), 1-51.
%H J. L. Arregui, <a href="http://arXiv.org/abs/math.NT/0109108">Tangent and Bernoulli numbers related to Motzkin and Catalan numbers by means of numerical triangles</a>, arXiv:math/0109108 [math.NT], 2001.
%H B. Bauslaugh and F. Ruskey, <a href="http://dx.doi.org/10.1007/BF01932127">Generating alternating permutations lexicographically</a>, Nordisk Tidskr. Informationsbehandling (BIT) 30 16-26 1990.
%H Carolina Benedetti, Rafael S. González D’León, Christopher R. H. Hanusa, Pamela E. Harris, Apoorva Khare, Alejandro H. Morales, and Martha Yip, <a href="https://www.cs.ox.ac.uk/people/dan.olteanu/papers/mo-amw18.pdf">The volume of the caracol polytope</a>, Séminaire Lotharingien de Combinatoire XX (2018), Article #YY, Proceedings of the 30th Conference on Formal Power, Series and Algebraic Combinatorics (Hanover), 2018.
%H Beáta Bényi and Péter Hajnal, <a href="https://arxiv.org/abs/1804.01868">Poly-Bernoulli Numbers and Eulerian Numbers</a>, arXiv:1804.01868 [math.CO], 2018.
%H Neil J. Y. Fan and Liao He, <a href="http://www.combinatorics.org/ojs/index.php/eljc/article/view/v22i2p45">The Complete cd-Index of Boolean Lattices</a>, Electron. J. Combin., 22 (2015), #P2.45.
%H Dominique Foata and Guo-Niu Han, <a href="http://www-irma.u-strasbg.fr/~foata/paper/pub123Seidel.pdf">Seidel Triangle Sequences and Bi-Entringer Numbers</a>, November 20, 2013.
%H Dominique Foata and Guo-Niu Han, <a href="https://doi.org/10.1016/j.ejc.2014.06.007">Seidel Triangle Sequences and Bi-Entringer Numbers</a>, European Journal of Combinatorics, 42 (2014), 243-260. [See Corollary 1.3. In Eq. (1.10), the power of x should be k-1 rather than k.]
%H Dominique Foata and Guo-Niu Han, <a href="http://arxiv.org/abs/1601.04371">André Permutation Calculus; a Twin Seidel Matrix Sequence</a>, arXiv:1601.04371 [math.CO], 2016.
%H B. Gourevitch, <a href="http://www.pi314.net">L'univers de Pi</a>.
%H G. Kreweras, <a href="http://archive.numdam.org/article/MSH_1976__53__5_0.pdf">Les préordres totaux compatibles avec un ordre partiel</a>, Math. Sci. Humaines No. 53 (1976), 5-30.
%H J. Millar, N. J. A. Sloane and N. E. Young, A new operation on sequences: the Boustrophedon transform, J. Combin. Theory, 17A (1996) 44-54 (<a href="http://neilsloane.com/doc/bous.txt">Abstract</a>, <a href="http://neilsloane.com/doc/bous.pdf">pdf</a>, <a href="http://neilsloane.com/doc/bous.ps">ps</a>).
%H C. Poupard, <a href="http://dx.doi.org/10.1016/0012-365X(82)90293-X">De nouvelles significations énumeratives des nombres d'Entringer</a>, Discrete Math., 38 (1982), 265-271.
%H C. Poupard, <a href="http://dx.doi.org/10.1006/eujc.1997.0147">Two other interpretations of the Entringer numbers</a>, Eur. J. Combinat. 18 (1997) 939-943.
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Boustrophedon_transform">Boustrophedon transform</a>.
%H <a href="/index/Bo#boustrophedon">Index entries for sequences related to boustrophedon transform</a>
%F From _Emeric Deutsch_, May 15 2004: (Start)
%F Let E[j] = A000111(j) = j! * [x^j](sec(x) + tan(x)) be the up/down or Euler numbers. For 1 <= k < n,
%F T(n, k) = Sum_{i=0..floor((k-1)/2)} (-1)^i * binomial(k, 2*i+1) * E[n-2*i-1];
%F T(n,k) = Sum_{i=0..floor((n-k)/2)} (-1)^i * binomial(n-k, 2*i) * E[n-2*i];
%F T(n, k) = Sum_{i=0..floor((n-k)/2)} (-1)^i * binomial(n-k, 2*i) * E[n-2*i]; and
%F T(n, n) = E[n] for n >= 1. (End)
%F From _Petros Hadjicostas_, Feb 17 2021: (Start)
%F If n is even, then T(n,k) = k!*(n-k)!*[x^(n-k),y^k] cos(x)/cos(x + y).
%F If n is odd, then T(n,k) = k!*(n-k)!*[x^k,y^(n-k)] sin(x)/cos(x + y).
%F (These were adapted and corrected from the formulas in Corollary 1.3 in Foata and Guo-Niu Han (2014).) (End)
%F Comment from Masanobu Kaneko: (Start)
%F A generating function that applies for all n, both even and odd:
%F Sum_{n=0..oo} Sum_{k=0..n} T(n,k) x^(n-k)/(n-k)! * y^k/k! = {cos x + sin y}/cos(x + y).
%F (End) - _N. J. A. Sloane_, Feb 06 2022
%e Triangle T(n,k) (with rows n >= 1 and columns k = 1..n) begins
%e 1
%e 1 1
%e 1 2 2
%e 2 4 5 5
%e 5 10 14 16 16
%e 16 32 46 56 61 61
%e ...
%e Each row is constructed by forming the partial sums of the previous row, reading from the right and repeating the final term.
%e T(4,3) = 5 because we have 41325, 41523, 42314, 42513 and 43512. All these permutations have length n+1 = 5, start with k+1 = 4, and they are down-up permutations.
%p f:=series(sec(x)+tan(x),x=0,25): E[0]:=1: for n from 1 to 20 do E[n]:=n!*coeff(f,x^n) od: T:=proc(n,k) if k<n then sum((-1)^i*binomial(k,2*i+1)*E[n-2*i-1],i=0..floor((k-1)/2)) elif k=n then E[n] else 0 fi end: seq(seq(T(n,k),k=1..n),n=1..10);
%p # Alternatively:
%p T := proc(n, k) option remember; if k = 0 then `if`(n = 0, 1, 0) else
%p T(n, k - 1) + T(n - 1, n - k) fi end:
%p for n from 1 to 6 do seq(T(n,k), k=1..n) od; # _Peter Luschny_, Aug 03 2017
%p # Third program:
%p T := proc(n, k) local w: if 0 = n mod 2 then w := coeftayl(cos(x)/cos(x + y), [x, y] = [0, 0], [n - k, k]): end if: if 1 = n mod 2 then w := coeftayl(sin(x)/cos(x + y), [x, y] = [0, 0], [k, n - k]): end if: w*(n - k)!*k!: end proc:
%p for n from 1 to 6 do seq(T(n,k), k=1..n) od; # _Petros Hadjicostas_, Feb 17 2021
%t ro[1] = {1}; ro[n_] := ro[n] = (s = Accumulate[ Reverse[ ro[n-1]]]; Append[ s, Last[s]]); Flatten[ Table[ ro[n], {n, 1, 10}]] (* _Jean-François Alcover_, Oct 03 2011 *)
%t nxt[lst_]:=Module[{lst2=Accumulate[Reverse[lst]]},Flatten[Join[ {lst2,Last[ lst2]}]]]; Flatten[NestList[nxt,{1},10]] (* _Harvey P. Dale_, Aug 17 2014 *)
%o (Haskell)
%o a008282 n k = a008282_tabl !! (n-1) !! (k-1)
%o a008282_row n = a008282_tabl !! (n-1)
%o a008282_tabl = iterate f [1] where
%o f xs = zs ++ [last zs] where zs = scanl1 (+) (reverse xs)
%o -- _Reinhard Zumkeller_, Dec 28 2011
%Y Cf. A010094, A000111, A099959, A009766, A236935.
%K nonn,tabl,easy,nice
%O 1,5
%A _N. J. A. Sloane_
%E Example and Formula sections edited by _Petros Hadjicostas_, Feb 17 2021