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.

Showing 1-5 of 5 results.

A340556 E2(n, k), the second-order Eulerian numbers with E2(0, k) = δ_{0, k}. Triangle read by rows, E2(n, k) for 0 <= k <= n.

Original entry on oeis.org

1, 0, 1, 0, 1, 2, 0, 1, 8, 6, 0, 1, 22, 58, 24, 0, 1, 52, 328, 444, 120, 0, 1, 114, 1452, 4400, 3708, 720, 0, 1, 240, 5610, 32120, 58140, 33984, 5040, 0, 1, 494, 19950, 195800, 644020, 785304, 341136, 40320, 0, 1, 1004, 67260, 1062500, 5765500, 12440064, 11026296, 3733920, 362880
Offset: 0

Views

Author

Peter Luschny, Feb 05 2021

Keywords

Comments

The second-order Eulerian number E2(n, k) is the number of Stirling permutations of order n with exactly k descents; here the last index is defined to be a descent. More formally, let Q_n denote the set of permutations of the multiset {1,1,2,2, ..., n,n} in which, for all j, all entries between two occurrences of j are larger than j, then E2(n, k) = card({s in Q_n with des(s) = k}), where des(s) = card({j: s(j) > s(j+1)}) is the number of descents of s.
Also the number of Riordan trapezoidal words of length n with k distinct letters (see Riordan 1976, p. 9).
Also the number of rooted plane trees on n + 1 vertices with k leaves (see Janson 2008, p. 543).
Let b(n) = (1/2)*Sum_{k=0..n-1} (-1)^k*E2(n-1, k+1) / C(2*n-1, k+1). Apparently b(n) = Bernoulli(n, 1) = -n*Zeta(1 - n) = Integral_{x=0..1}F_n(x) for n >= 1. Here F_n(x) are the signed Fubini polynomials (A278075). (See Rzadkowski and Urlinska, example 4.)

Examples

			Triangle starts:
  [0] 1;
  [1] 0, 1;
  [2] 0, 1, 2;
  [3] 0, 1, 8,    6;
  [4] 0, 1, 22,   58,    24;
  [5] 0, 1, 52,   328,   444,     120;
  [6] 0, 1, 114,  1452,  4400,    3708,    720;
  [7] 0, 1, 240,  5610,  32120,   58140,   33984,    5040;
  [8] 0, 1, 494,  19950, 195800,  644020,  785304,   341136,   40320;
  [9] 0, 1, 1004, 67260, 1062500, 5765500, 12440064, 11026296, 3733920, 362880.
To illustrate the generating function for row 3: The expansion of (1 - x)^7*(x*exp(-x) + 16*x^2*exp(-x)^2 + (243*x^3*exp(-x)^3)/2) gives the polynomial x + 8*x^2 + 6*x^3. The coefficients of this polynomial give row 3.
.
Stirling permutations of order 3 with exactly k descents: (When counting the descents one may assume an invisible '0' appended to the permutations.)
  T[3, k=0]:
  T[3, k=1]: 112233;
  T[3, k=2]: 331122; 223311; 221133; 133122; 122331; 122133; 113322; 112332;
  T[3, k=3]: 332211; 331221; 233211; 221331; 133221; 123321.
		

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, 2nd ed. Addison-Wesley, Reading, MA, 1994, p. 270.

Crossrefs

Indexing the second-order Eulerian numbers comes in three flavors: A008517 (following Riordan and Comtet), A201637 (following Graham, Knuth, and Patashnik) and this indexing, extending the definition of Gessel and Stanley. (A008517 is the main entry of the numbers.) The corresponding triangles of the first-order Eulerian numbers are A008292, A173018, and A123125.
Row reversed: A163936 (with offset = 0).
Values: E2poly(n, 1) = A001147(n), E2poly(n, -1) ~ -A001662(n+1), E2poly(n, 2) = A112487(n), 2^n*E2poly(n, 1/2) = A000311(n+1), 2^n*E2poly(n, -1/2) = A341106(n).

Programs

  • Maple
    # Using the recurrence:
    E2 := proc(n, k) option remember;
    if k = 0 and n = 0 then return 1 fi; if n < 0 then return 0 fi;
    E2(n-1, k)*k + E2(n-1, k-1)*(2*n - k) end: seq(seq(E2(n, k), k = 0..n), n = 0..9);
    # Using the row generating function:
    E2egf := n -> (1-x)^(2*n+1)*add(k^(n+k)/k!*(x*exp(-x))^k, k=0..n);
    T := (n, k) -> coeftayl(E2egf(n), x=0, k): seq(print(seq(T(n, j),j=0..n)), n=0..7);
    # Using the built-in function:
    E2 := (n, k) -> `if`(k=0, k^n, combinat:-eulerian2(n, k-1)):
    # Using the compositional inverse (series reversion):
    E2triangle := proc(N) local r, s, C; Order := N + 2;
    s := solve(y = series(x - t*(exp(x) - 1), x), x):
    r := n -> -n!*(t - 1)^(2*n - 1)*coeff(s, y, n); C := [seq(expand(r(n)), n = 1..N)];
    seq(print(seq(coeff(C[n+1], t, k), k = 0..n)), n = 0..N-1) end: E2triangle(10);
  • Mathematica
    T[n_, k_] := T[n, k] = If[k == 0, Boole[n == 0], If[n < 0, 0, k T[n - 1, k] + (2 n - k) T[n - 1, k - 1]]]; Table[T[n, k], {n, 0, 9}, {k, 0, n}] // Flatten
    (* Via row polynomials: *)
    E2poly[n_] := If[n == 0, 1,
      Expand[Simplify[x (x - 1)^(2 n) D[((1 - x)^(1 - 2 n) E2poly[n - 1]), x]]]];
    Table[CoefficientList[E2poly[n], x], {n, 0, 9}] // Flatten
    (* Series reversion *)
    Revert[gf_, len_] := Module[{S = InverseSeries[Series[gf, {x, 0, len + 1}], x]},
    Table[CoefficientList[(n + 1)! (1 - t)^(2 n + 1) Coefficient[S, x, n + 1], t],
    {n, 0, len}] // Flatten]; Revert[x + t - t Exp[x], 6]
  • PARI
    E2poly(n) = if(n == 0, 1, x*(x-1)^(2*n)*deriv((1-x)^(1-2*n)*E2poly(n-1)));
    { for(n = 0, 9, print(Vecrev(E2poly(n)))) }
    
  • PARI
    T(n, k) = sum(j=0, n-k, (-1)^(n-j)*binomial(2*n+1, j)*stirling(2*n-k-j+1, n-k-j+1, 1)); \\ Michel Marcus, Feb 11 2021
    
  • SageMath
    # See also link to notebook.
    @cached_function
    def E2(n, k):
        if n < 0: return 0
        if k == 0: return k^n
        return k * E2(n - 1, k) + (2*n - k) * E2(n - 1, k - 1)  # Peter Luschny, Mar 08 2025

Formula

E2(n, k) = E2(n-1, k)*k + E2(n-1, k-1)*(2*n - k) for n > 0 and 0 <= k <= n, and E2(0, 0) = 1; in all other cases E(n, k) = 0.
E2(n, k) = Sum_{j=0..n-k}(-1)^(n-j)*binomial(2*n+1, j)*Stirling1(2*n-k-j+1, n-k-j+1).
E2(n, k) = Sum_{j=0..k}(-1)^(k-j)*binomial(2*n + 1, k - j)*Stirling2(n + j, j).
Stirling1(x, x - n) = (-1)^n*Sum_{k=0..n} E2(n, k)*binomial(x + k - 1, 2*n).
Stirling2(x, x - n) = Sum_{k=0..n} E2(n, k)*binomial(x + n - k, 2*n).
E2poly(n, x) = Sum_{k=0..n} E2(n, k)*x^k, as row polynomials.
E2poly(n, x) = x*(x-1)^(2*n)*d_{x}((1-x)^(1-2*n)*E2poly(n-1)) for n>=1 and E2poly(0)=1.
E2poly(n, x) = (1 - x)^(2*n + 1)*Sum_{k=0..n}(k^(n + k)/k!)*(x*exp(-x))^k.
W(n, k) = [x^k] (1+x)^n*E2poly(n, x/(1 + x)) are the Ward numbers A269939.
E2(n, k) = [x^k] (1-x)^n*Wpoly(n, x/(1 - x)); Wpoly(n, x) = Sum_{k=0..n}W(n, k)*x^k.
W(n, k) = Sum_{j=0..k} E2(n, j)*binomial(n - j, n - k).
E2(n, k) = Sum_{j=0..k} (-1)^(k-j)*W(n, j)*binomial(n - j, k - j).
The compositional inverse with respect to x of x - t*(exp(x) - 1) (see B. Drake):
T(n, k) = [t^k](n+1)!*(1-t)^(2*n+1)*[x^(n+1)] InverseSeries(x - t*(exp(x)-1), x).
AS1(n, k) = Sum_{j=0..n-k} binomial(j, n-2*k)*E2(n-k, j+1), where AS1(n, k) are the associated Stirling numbers of the first kind (A008306, A106828).
E2(n, k) = Sum_{j=0..n-k+1} (-1)^(n-k-j+1)*AS1(n+j, j)*binomial(n-j, n-k-j+1), for n >= 1.
AS2(n, k) = Sum_{j=0..n-k} binomial(j, n-2*k)*E2(n-k, n-k-j) for n >=1, where AS2(n, k) are the associated Stirling numbers of the second kind (A008299, A137375).
E2(n, k) = Sum_{j=0..k} (-1)^(k-j)*AS2(n + j, j)*binomial(n - j, k - j).

A112486 Coefficient triangle for polynomials used for e.g.f.s for unsigned Stirling1 diagonals.

Original entry on oeis.org

1, 1, 1, 2, 5, 3, 6, 26, 35, 15, 24, 154, 340, 315, 105, 120, 1044, 3304, 4900, 3465, 945, 720, 8028, 33740, 70532, 78750, 45045, 10395, 5040, 69264, 367884, 1008980, 1571570, 1406790, 675675, 135135, 40320, 663696, 4302216, 14777620, 29957620
Offset: 0

Views

Author

Wolfdieter Lang, Sep 12 2005

Keywords

Comments

The k-th diagonal of |A008275| appears as the k-th column in |A008276| with k-1 leading zeros.
The recurrence, given below, is derived from (d/dx)g1(k,x) - g1(k,x)= x*(d/dx)g1(k-1,x) + g1(k-1,x), k >= 1, with input g(-1,x):=0 and initial condition g1(k,0)=1, k >= 0. This differential recurrence for the e.g.f. g1(k,x) follows from the one for unsigned Stirling1 numbers.
The column sequences start with A000142 (factorials), A001705, A112487- A112491, for m=0,...,5.
The main diagonal gives (2*k-1)!! = A001147(k), k >= 1.
This computation was inspired by the Bender article (see links), where the Stirling polynomials are discussed.
The e.g.f. for the k-th diagonal, k >= 1, of the unsigned Stirling1 triangle |A008275| with k-1 leading zeros is g1(k-1,x) = exp(x)*Sum_{m=0..k-1} a(k,m)*(x^(k-1+m))/(k-1+m)!.
a(k,n) = number of lists with entries from [n] such that (i) each element of [n] occurs at least once and at most twice, (ii) for each i that occurs twice, all entries between the two occurrences of i are > i, and (iii) exactly k elements of [n] occur twice. Example: a(1,2)=5 counts 112, 121, 122, 211, 221, and a(2,2)=3 counts 1122,1221,2211. - David Callan, Nov 21 2011

Examples

			Triangle begins:
    1;
    1,    1;
    2,    5,     3;
    6,   26,    35,    15;
   24,  154,   340,   315,   105;
  120, 1044,  3304,  4900,  3465,   945;
  720, 8028, 33740, 70532, 78750, 45045, 10395;
k=3 column of |A008276| is [0,0,2,11,35,85,175,...] (see A000914), its e.g.f. exp(x)*(2*x^2/2! + 5* x^3/3! + 3*x^4/4!).
		

Crossrefs

Cf. A112007 (triangle for o.g.f.s for unsigned Stirling1 diagonals). A112487 (row sums).

Programs

  • Maple
    A112486 := proc(n,k)
        if n < 0 or k<0 or  k> n then
            0 ;
        elif n = 0 then
            1 ;
        else
            (n+k)*procname(n-1,k)+(n+k-1)*procname(n-1,k-1) ;
        end if;
    end proc: # R. J. Mathar, Dec 19 2013
  • Mathematica
    A112486 [n_, k_] := A112486[n, k] = Which[n<0 || k<0 || k>n, 0, n == 0, 1, True, (n+k)*A112486[n-1, k]+(n+k-1)*A112486[n-1, k-1]]; Table[A112486[n, k], {n, 0, 9}, {k, 0, n}] // Flatten (* Jean-François Alcover, Mar 05 2014, after R. J. Mathar *)

Formula

a(k, m) = (k+m)*a(k-1, m) + (k+m-1)*a(k-1, m-1) for k >= m >= 0, a(0, 0)=1, a(k, -1):=0, a(k, m)=0 if k < m.
From Tom Copeland, Oct 05 2011: (Start)
With polynomials
P(0,t) = 0
P(1,t) = 1
P(2,t) = -(1 + t)
P(3,t) = 2 + 5 t + 3 t^2
P(4,t) = -( 6 + 26 t + 35 t^2 + 15 t^3)
P(5,t) = 24 + 154 t +340 t^2 + 315 t^3 + 105 t^4
Apparently, P(n,t) = (-1)^(n+1) PW[n,-(1+t)] where PW are the Ward polynomials A134991. If so, an e.g.f. for the polynomials is
A(x,t) = -(x+t+1)/t - LW{-((t+1)/t) exp[-(x+t+1)/t]}, where LW(x) is a suitable branch of the Lambert W Fct. (e.g., see A135338). The comp. inverse in x (about x = 0) is B(x) = x + (t+1) [exp(x) - x - 1]. See A112487 for special case t = 1. These results are a special case of A134685 with u(x) = B(x), i.e., u_1=1 and (u_n)=(1+t) for n>0.
Let h(x,t) = 1/(dB(x)/dx) = 1/[1+(1+t)*(exp(x)-1)], an e.g.f. in x for row polynomials in t of signed A028246 , then P(n,t), is given by
(h(x,t)*d/dx)^n x, evaluated at x=0, i.e., A(x,t)=exp(x*h(u,t)*d/du) u, evaluated at u=0. Also, dA(x,t)/dx = h(A(x,t),t).
The e.g.f. A(x,t) = -v * Sum_{j>=1} D(j-1,u) (-z)^j / j! where u=-(x+t+1)/t, v=1+u, z=(1+t*v)/(t*v^2) and D(j-1,u) are the polynomials of A042977. dA/dx = -1/[t*(v-A)].(End)
A133314 applied to the derivative of A(x,t) implies (a.+b.)^n = 0^n, for (b_n)=P(n+1,t) and (a_0)=1, (a_1)=t+1, and (a_n)=t*P(n,t) otherwise. E.g., umbrally, (a.+b.)^2 = a_2*b_0 + 2 a_1*b_1 + a_0*b_2 =0. - Tom Copeland, Oct 08 2011
The row polynomials R(n,x) may be calculated using R(n,x) = 1/x^(n+1)*D^n(x), where D is the operator (x^2+x^3)*d/dx. - Peter Bala, Jul 23 2012
For n>0, Sum_{k=0..n} a(n,k)*(-1/(1+W(t)))^(n+k+1) = (t d/dt)^(n+1) W(t), where W(t) is Lambert W function. For t=-x, this gives Sum_{k>=1} k^(k+n)*x^k/k! = - Sum_{k=0..n} a(n,k)*(-1/(1+W(-x)))^(n+k+1). - Max Alekseyev, Nov 21 2019
Conjecture: row polynomials are R(n,x) = Sum_{i=0..n} Sum_{j=0..i} Sum_{k=0..j} (n+i)!*Stirling2(n+j-k,j-k)*x^k*(x+1)^(j-k)*(-1)^(n+j+k)/((n+j-k)!*(i-j)!*k!). - Mikhail Kurkov, Apr 21 2025

A032034 Shifts left under "AIJ" (ordered, indistinct, labeled) transform.

Original entry on oeis.org

2, 2, 10, 82, 938, 13778, 247210, 5240338, 128149802, 3551246162, 109979486890, 3764281873042, 141104799067178, 5749087305575378, 252969604725106090, 11955367835505775378, 603967991604199335722, 32479636694930586142802, 1852497140997527094395050
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

  • Maple
    with(combinat): A032034 := n -> add(eulerian2(n-1,k)*2^(k+1), k=0..n-1):
    seq(A032034(n), n=1..17); # Peter Luschny, Nov 10 2012
  • Mathematica
    Eulerian2[n_, k_] := Eulerian2[n, k] = If[k == 0, 1, If[k == n, 0, Eulerian2[n-1, k] (k+1) + Eulerian2[n-1, k-1] (2n-k-1)]];
    a[n_] := Sum[Eulerian2[n-1, k] 2^(k+1), {k, 0, n-1}];
    Array[a, 20] (* Jean-François Alcover, Jun 01 2019, after Peter Luschny *)
  • Maxima
    a(n):=if n=1 then 2 else ((n-1)!*sum(binomial(n+k-1,n-1)*sum((-1)^(j+n+1)*binomial(k,j)*sum((binomial(j,l)*(j-l)!*2^(j-l)*(-1)^l*stirling2(n-l+j-1,j-l))/(n-l+j-1)!,l,0,j),j,1,k),k,1,n-1)); /* Vladimir Kruchinin, Jan 24 2012 */
    
  • PARI
    seq(n)={my(p=O(x)); for(i=1, n, p=intformal(1 + 1/(1-p))); Vec(serlaplace(p))} \\ Andrew Howroyd, Sep 19 2018
  • Sage
    @CachedFunction
    def eulerian2(n, k):
        if k==0: return 1
        elif k==n: return 0
        return eulerian2(n-1, k)*(k+1)+eulerian2(n-1, k-1)*(2*n-k-1)
    A032034 = lambda n: add(eulerian2(n-1,k)*2^(k+1) for k in (0..n-1))
    [A032034(n) for n in (1..17)]  # Peter Luschny, Nov 10 2012
    

Formula

a(n) = ((n-1)!*sum(k=1..n-1, binomial(n+k-1,n-1)*sum(j=1..k, (-1)^(j+n+1)*binomial(k,j)*sum(l=0..j, (binomial(j,l)*(j-l)!*2^(j-l)*(-1)^l*stirling2(n-l+j-1,j-l))/(n-l+j-1)!)))), n>1, a(1)=2. - Vladimir Kruchinin, Jan 24 2012
Let p(n,w) = w*Sum_{k=0..n-1} ((-1)^k*E2(n-1,k)*w^k)/(1+w)^(2*n-1),
E2 the second-order Eulerian numbers as defined by Knuth, then a(n) = p(n,-2). - Peter Luschny, Nov 10 2012
G.f.: 1 + 1/Q(0), where Q(k)= 1 + k*x - 2*x*(k+1)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, May 01 2013
a(n) = 2 * A032188(n). - Alois P. Heinz, Jul 04 2018

A228608 E.g.f. A(x) satisfies: A'(x) = A(x)^2 + A(x)^4.

Original entry on oeis.org

1, 2, 12, 128, 1968, 39488, 977088, 28742912, 979744512, 37968868352, 1648597834752, 79272057049088, 4181485522464768, 240067201819885568, 14902137637759008768, 994529776192394166272, 71009035425186633940992, 5401058272888913168433152, 435991257271370763778916352
Offset: 0

Views

Author

Paul D. Hanna, Dec 18 2013

Keywords

Examples

			E.g.f.: A(x) = 1 + 2*x + 12*x^2/2! + 128*x^3/3! + 1968*x^4/4! + 39488*x^5/5! +...
Related expansions.
A(x)^2 = 1 + 4*x + 32*x^2/2! + 400*x^3/3! + 6848*x^4/4! + 149056*x^5/5! +...
A(x)^4 = 1 + 8*x + 96*x^2/2! + 1568*x^3/3! + 32640*x^4/4! + 828032*x^5/5! +...
The logarithm of e.g.f. A(x) begins:
log(A(x)) = 2*x + 8*x^2/2! + 72*x^3/3! + 992*x^4/4! + 18336*x^5/5! +...
and equals Integral A(x) + A(x)^3 dx, where
A(x)^3 = 1 + 6*x + 60*x^2/2! + 864*x^3/3! + 16368*x^4/4! + 385344*x^5/5! +...
		

Crossrefs

Programs

  • Mathematica
    CoefficientList[Exp[InverseSeries[Series[1-Exp[-x]-ArcTan[Tanh[x/2]], {x, 0, 20}], x]],x]*Range[0, 20]! (* Vaclav Kotesovec, Dec 20 2013 *)
  • PARI
    /* Explicit formula: */
    {a(n)=local(A,X=x+x^2*O(x^n));A=exp(serreverse(1-exp(-X) - atan(tanh(X/2))));n!*polcoeff(A,n)}
    for(n=0,20,print1(a(n),", "))
    
  • PARI
    /* By definition: A'(x) = A(x)^2 + A(x)^4: */
    {a(n)=local(A=1+x); for(i=1, n, A=1+intformal(A^2+A^4+x*O(x^n))); n!*polcoeff(A, n)}
    for(n=0,20,print1(a(n),", "))
    
  • PARI
    /* From: A(x) = exp( Integral A(x) + A(x)^3 dx ): */
    {a(n)=local(A=1+x); for(i=1, n, A=exp(intformal(A+A^3)+x*O(x^n))); n!*polcoeff(A, n)}
    for(n=0,20,print1(a(n),", "))

Formula

E.g.f. A(x) satisfies:
(1) A(x) = exp( Integral A(x) + A(x)^3 dx ) with A(0)=1.
(2) A(x) = (1 + B(x))/(1 - B(x)) where B(x) = tan(1-x - 1/A(x)).
(3) log(A(x)) = Series_Reversion( 1-exp(-x) - atan(tanh(x/2)) ).
(4) A( 1-exp(-x) - atan(tanh(x/2)) ) = exp(x).
a(n) ~ n! / (GAMMA(1/3) * 3^(1/3) * n^(2/3) * (1-Pi/4)^(n+1/3)). - Vaclav Kotesovec, Jan 26 2014

A118787 Triangle where T(n,k) = n!*[x^k] ( x/(2*x + log(1-x)) )^(n+1), for n>=k>=0, read by rows.

Original entry on oeis.org

1, 1, 1, 2, 3, 5, 6, 12, 23, 41, 24, 60, 130, 255, 469, 120, 360, 870, 1860, 3679, 6889, 720, 2520, 6720, 15540, 32858, 65247, 123605, 5040, 20160, 58800, 146160, 328734, 689388, 1371887, 2620169, 40320, 181440, 574560, 1527120, 3638376, 8029980
Offset: 0

Views

Author

Paul D. Hanna, Apr 29 2006

Keywords

Comments

Row sums are A112487. Main diagonal is A032188(n) = number of labeled series-reduced mobiles (circular rooted trees) with n leaves.

Examples

			Triangle begins:
1;
1, 1;
2, 3, 5;
6, 12, 23, 41;
24, 60, 130, 255, 469;
120, 360, 870, 1860, 3679, 6889;
720, 2520, 6720, 15540, 32858, 65247, 123605;
5040, 20160, 58800, 146160, 328734, 689388, 1371887, 2620169; ...
Triangle is formed from powers of F(x) = x/(2*x + log(1-x)):
F(x)^1 = (1) + 1/2*x + 7/12*x^2 + 17/24*x^3 + 629/720*x^4 +...
F(x)^2 = (1 + x)/1! +17/12*x^2 + 2*x^3 + 671/240*x^4 ...
F(x)^3 = (2 + 3*x + 5*x^2)/2! + 4*x^3 + 1489/240*x^4 +...
F(x)^4 = (6 + 12*x + 23*x^2 + 41/6*x^3)/3! + 8351/720*x^4 +...
F(x)^5 = (24 + 60*x + 130*x^2 + 255*x^3 + 469*x^4)/4! +...
		

Crossrefs

Programs

  • PARI
    {T(n,k)=local(x=X+X^2*O(X^(k+2)));n!*polcoeff((x/(2*x+log(1-x)))^(n+1),k,X)}

Formula

Main diagonal has e.g.f.: series_reversion[2*x+log(1-x)].
Showing 1-5 of 5 results.