cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A008282 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.

Original entry on oeis.org

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, 256, 272, 272, 272, 544, 800, 1024, 1202, 1324, 1385, 1385, 1385, 2770, 4094, 5296, 6320, 7120, 7664, 7936, 7936, 7936, 15872, 23536, 30656, 36976, 42272, 46366, 49136, 50521, 50521
Offset: 1

Views

Author

Keywords

Examples

			Triangle T(n,k) (with rows n >= 1 and columns k = 1..n) begins
   1
   1  1
   1  2  2
   2  4  5  5
   5 10 14 16 16
  16 32 46 56 61 61
  ...
Each row is constructed by forming the partial sums of the previous row, reading from the right and repeating the final term.
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.
		

References

  • R. C. Entringer, A combinatorial interpretation of the Euler and Bernoulli numbers, Nieuw Archief voor Wiskunde, 14 (1966), 241-246.

Crossrefs

Programs

  • Haskell
    a008282 n k = a008282_tabl !! (n-1) !! (k-1)
    a008282_row n = a008282_tabl !! (n-1)
    a008282_tabl = iterate f [1] where
       f xs = zs ++ [last zs] where zs = scanl1 (+) (reverse xs)
    -- Reinhard Zumkeller, Dec 28 2011
  • Maple
    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 kPeter Luschny, Aug 03 2017
    # Third program:
    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:
    for n from 1 to 6 do seq(T(n,k), k=1..n) od; # Petros Hadjicostas, Feb 17 2021
  • Mathematica
    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 *)
    nxt[lst_]:=Module[{lst2=Accumulate[Reverse[lst]]},Flatten[Join[ {lst2,Last[ lst2]}]]]; Flatten[NestList[nxt,{1},10]] (* Harvey P. Dale, Aug 17 2014 *)

Formula

From Emeric Deutsch, May 15 2004: (Start)
Let E[j] = A000111(j) = j! * [x^j](sec(x) + tan(x)) be the up/down or Euler numbers. For 1 <= k < n,
T(n, k) = Sum_{i=0..floor((k-1)/2)} (-1)^i * binomial(k, 2*i+1) * E[n-2*i-1];
T(n,k) = Sum_{i=0..floor((n-k)/2)} (-1)^i * binomial(n-k, 2*i) * E[n-2*i];
T(n, k) = Sum_{i=0..floor((n-k)/2)} (-1)^i * binomial(n-k, 2*i) * E[n-2*i]; and
T(n, n) = E[n] for n >= 1. (End)
From Petros Hadjicostas, Feb 17 2021: (Start)
If n is even, then T(n,k) = k!*(n-k)!*[x^(n-k),y^k] cos(x)/cos(x + y).
If n is odd, then T(n,k) = k!*(n-k)!*[x^k,y^(n-k)] sin(x)/cos(x + y).
(These were adapted and corrected from the formulas in Corollary 1.3 in Foata and Guo-Niu Han (2014).) (End)
Comment from Masanobu Kaneko: (Start)
A generating function that applies for all n, both even and odd:
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).
(End) - N. J. A. Sloane, Feb 06 2022

Extensions

Example and Formula sections edited by Petros Hadjicostas, Feb 17 2021