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-10 of 13 results. Next

A008277 Triangle of Stirling numbers of the second kind, S2(n,k), n >= 1, 1 <= k <= n.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 7, 6, 1, 1, 15, 25, 10, 1, 1, 31, 90, 65, 15, 1, 1, 63, 301, 350, 140, 21, 1, 1, 127, 966, 1701, 1050, 266, 28, 1, 1, 255, 3025, 7770, 6951, 2646, 462, 36, 1, 1, 511, 9330, 34105, 42525, 22827, 5880, 750, 45, 1, 1, 1023, 28501, 145750, 246730, 179487, 63987, 11880, 1155, 55, 1
Offset: 1

Views

Author

Keywords

Comments

Also known as Stirling set numbers and written {n, k}.
S2(n,k) counts partitions of an n-set into k nonempty subsets.
From Manfred Boergens, Apr 07 2025: (Start)
With regard to the preceding comment:
For disjoint collections of subsets see A256894.
For arbitrary collections of subsets see A163353.
For arbitrary collections of nonempty subsets see A055154. (End)
Triangle S2(n,k), 1 <= k <= n, read by rows, given by [0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, ...] DELTA [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, ...] where DELTA is Deléham's operator defined in A084938.
Number of partitions of {1, ..., n+1} into k+1 nonempty subsets of nonconsecutive integers, including the partition 1|2|...|n+1 if n=k. E.g., S2(3,2)=3 since the number of partitions of {1,2,3,4} into three subsets of nonconsecutive integers is 3, i.e., 13|2|4, 14|2|3, 1|24|3. - Augustine O. Munagi, Mar 20 2005
Draw n cards (with replacement) from a deck of k cards. Let prob(n,k) be the probability that each card was drawn at least once. Then prob(n,k) = S2(n,k)*k!/k^n (see A090582). - Rainer Rosenthal, Oct 22 2005
Define f_1(x), f_2(x), ..., such that f_1(x)=e^x and for n = 2, 3, ..., f_{n+1}(x) = (d/dx)(x*f_n(x)). Then f_n(x) = e^x*Sum_{k=1..n} S2(n,k)*x^(k-1). - Milan Janjic, May 30 2008
From Peter Bala, Oct 03 2008: (Start)
For tables of restricted Stirling numbers of the second kind see A143494 - A143496.
S2(n,k) gives the number of 'patterns' of words of length n using k distinct symbols - see [Cooper & Kennedy] for an exact definition of the term 'pattern'. As an example, the words AADCBB and XXEGTT, both of length 6, have the same pattern of letters. The five patterns of words of length 3 are AAA, AAB, ABA, BAA and ABC giving row 3 of this table as (1,3,1).
Equivalently, S2(n,k) gives the number of sequences of positive integers (N_1,...,N_n) of length n, with k distinct entries, such that N_1 = 1 and N_(i+1) <= 1 + max{j = 1..i} N_j for i >= 1 (restricted growth functions). For example, Stirling(4,2) = 7 since the sequences of length 4 having 2 distinct entries that satisfy the conditions are (1,1,1,2), (1,1,2,1), (1,2,1,1), (1,1,2,2), (1,2,2,2), (1,2,2,1) and (1,2,1,2).
(End)
Number of combinations of subsets in the plane. - Mats Granvik, Jan 13 2009
S2(n+1,k+1) is the number of size k collections of pairwise disjoint, nonempty subsets of [n]. For example: S2(4,3)=6 because there are six such collections of subsets of [3] that have cardinality two: {(1)(23)},{(12)(3)}, {(13)(2)}, {(1)(2)}, {(1)(3)}, {(2)(3)}. - Geoffrey Critzer, Apr 06 2009
Consider a set of A000217(n) balls of n colors in which, for each integer k = 1 to n, exactly one color appears in the set a total of k times. (Each ball has exactly one color and is indistinguishable from other balls of the same color.) a(n+1, k+1) equals the number of ways to choose 0 or more balls of each color in such a way that exactly (n-k) colors are chosen at least once, and no two colors are chosen the same positive number of times. - Matthew Vandermast, Nov 22 2010
S2(n,k) is the number of monotonic-labeled forests on n vertices with exactly k rooted trees, each of height one or less. See link "Counting forests with Stirling and Bell numbers" below. - Dennis P. Walsh, Nov 16 2011
If D is the operator d/dx, and E the operator xd/dx, Stirling numbers are given by: E^n = Sum_{k=1..n} S2(n,k) * x^k*D^k. - Hyunwoo Jang, Dec 13 2011
The Stirling polynomials of the second kind (a.k.a. the Bell / Touchard polynomials) are the umbral compositional inverses of the falling factorials (a.k.a. the Pochhammer symbol or Stirling polynomials of the first kind), i.e., binomial(Bell(.,x),n) = x^n/n! (cf. Copeland's 2007 formulas), implying binomial(xD,n) = binomial(Bell(.,:xD:),n) = :xD:^n/n! where D = d/dx and :xD:^n = x^n*D^n. - Tom Copeland, Apr 17 2014
S2(n,k) is the number of ways to nest n matryoshkas (Russian nesting dolls) so that exactly k matryoshkas are not contained in any other matryoshka. - Carlo Sanna, Oct 17 2015
The row polynomials R(n, x) = Sum_{k=1..n} S2(n, k)*x^k appear in the numerator of the e.g.f. of n-th powers, E(n, x) = Sum_{m>=0} m^n*x^m/m!, as E(n, x) = exp(x)*x*R(n, x), for n >= 1. - Wolfdieter Lang, Apr 02 2017
With offsets 0 for n and k this is the Sheffer product matrix A007318*A048993 denoted by (exp(t), (exp(t) - 1)) with e.g.f. exp(t)*exp(x*(exp(t) - 1)). - Wolfdieter Lang, Jun 20 2017
Number of words on k+1 unlabeled letters of length n+1 with no repeated letters. - Thomas Anton, Mar 14 2019
Also coefficients of moments of Poisson distribution about the origin expressed as polynomials in lambda. [Haight] (see also A331155). - N. J. A. Sloane, Jan 14 2020
k!*S2(n,k) is the number of surjections from an n-element set to a k-element set. - Jianing Song, Jun 01 2022

Examples

			The triangle S2(n, k) begins:
\ k    1       2       3        4         5         6         7         8        9
n \   10      11      12       13        14        15       ...
----------------------------------------------------------------------------------
1  |   1
2  |   1       1
3  |   1       3       1
4  |   1       7       6        1
5  |   1      15      25       10         1
6  |   1      31      90       65        15         1
7  |   1      63     301      350       140        21         1
8  |   1     127     966     1701      1050       266        28         1
9  |   1     255    3025     7770      6951      2646       462        36        1
10 |   1     511    9330    34105     42525     22827      5880       750       45
       1
11 |   1    1023   28501   145750    246730    179487     63987     11880     1155
      55       1
12 |   1    2047   86526   611501   1379400   1323652    627396    159027    22275
    1705      66       1
13 |   1    4095  261625  2532530   7508501   9321312   5715424   1899612   359502
   39325    2431      78        1
14 |   1    8191  788970 10391745  40075035  63436373  49329280  20912320  5135130
  752752   66066    3367       91         1
15 |   1   16383 2375101 42355950 210766920 420693273 408741333 216627840 67128490
12662650 1479478  106470     4550       105         1
...
----------------------------------------------------------------------------------
x^4 = 1 x_(1) + 7 x_(2) + 6 x_(3) + 1 x_(4), where x_(k) = P(x,k) = k!*C(x,k). - _Daniel Forgues_, Jan 16 2016
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 835.
  • A. T. Benjamin and J. J. Quinn, Proofs that really count: the art of combinatorial proof, M.A.A. 2003, p. 103ff.
  • B. A. Bondarenko, Generalized Pascal Triangles and Pyramids (in Russian), FAN, Tashkent, 1990, ISBN 5-648-00738-8.
  • G. Boole, Finite Differences, 5th ed. New York, NY: Chelsea, 1970.
  • C. A. Charalambides, Enumerative Combinatorics, Chapman & Hall/CRC, 2002, Theorem 8.11, pp. 298-299.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 310.
  • J. H. Conway and R. K. Guy, The Book of Numbers, Springer, p. 92.
  • F. N. David, M. G. Kendall, and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 223.
  • S.N. Elaydi, An Introduction to Difference Equations, 3rd ed. Springer, 2005.
  • H. H. Goldstine, A History of Numerical Analysis, Springer-Verlag, 1977; Section 2.7.
  • R. L. Graham, D. E. Knuth, and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 244.
  • Frank Avery Haight, Handbook of the Poisson distribution, John Wiley, 1967. See pages 6,7.
  • A. D. Korshunov, Asymptotic behavior of Stirling numbers of the second kind. (Russian) Metody Diskret. Analiz. No. 39 (1983), 24-41.
  • E. Kuz'min and A. I. Shirshov: On the number e, pp. 111-119, eq.(6), in: Kvant Selecta: Algebra and Analysis, I, ed. S. Tabachnikov, Am.Math.Soc., 1999, p. 116, eq. (11).
  • J. Riordan, An Introduction to Combinatorial Analysis, p. 48.
  • J. Stirling, The Differential Method, London, 1749; see p. 7.

Crossrefs

Cf. A008275 (Stirling numbers of first kind), A048993 (another version of this triangle).
See also A331155.
Cf. A000110 (row sums), A102661 (partial row sums).

Programs

  • Haskell
    a008277 n k = a008277_tabl !! (n-1) !! (k-1)
    a008277_row n = a008277_tabl !! (n-1)
    a008277_tabl = map tail $ a048993_tabl  -- Reinhard Zumkeller, Mar 26 2012
    
  • J
    n ((] (1 % !)) * +/@((^~ * (] (1 ^ |.)) * (! {:)@]) i.@>:)) k NB. _Stephen Makdisi, Apr 06 2016
    
  • Magma
    [[StirlingSecond(n,k): k in [1..n]]: n in [1..12]]; // G. C. Greubel, May 22 2019
  • Maple
    seq(seq(combinat[stirling2](n, k), k=1..n), n=1..10); # Zerinvary Lajos, Jun 02 2007
    stirling_2 := (n,k) -> (1/k!) * add((-1)^(k-i)*binomial(k,i)*i^n, i=0..k);
  • Mathematica
    Table[StirlingS2[n, k], {n, 11}, {k, n}] // Flatten (* Robert G. Wilson v, May 23 2006 *)
    BellMatrix[f_, len_] := With[{t = Array[f, len, 0]}, Table[BellY[n, k, t], {n, 0, len - 1}, {k, 0, len - 1}]];
    rows = 12;
    B = BellMatrix[1&, rows];
    Table[B[[n, k]], {n, 2, rows}, {k, 2, n}] // Flatten (* Jean-François Alcover, Jun 28 2018, after Peter Luschny *)
    a[n_, n_] := 1; a[n_, 1] := 1;
    a[n_, k_] := a[n, k] = a[n-1, k-1] + k a[n-1, k]; Flatten@
    Table[a[n, k], {n, 1, 11}, {k, 1, n}] (* Oliver Seipel, Jun 12 2024 *)
    With[{m = 11},
     Flatten@MapIndexed[Take[#, #2[[1]]] &,
       Transpose@
        Table[Range[1, m]! Coefficient[(E^x-1)^k/k! + O[x]^(m+1), x,
    Range[1, m]], {k, 1, m}]]] (* Oliver Seipel, Jun 12 2024 *)
  • Maxima
    create_list(stirling2(n+1,k+1),n,0,30,k,0,n); /* Emanuele Munarini, Jun 01 2012 */
    
  • PARI
    for(n=1,22,for(k=1,n,print1(stirling(n,k,2),", "));print()); \\ Joerg Arndt, Apr 21 2013
    
  • PARI
    Stirling2(n,k)=sum(i=0,k,(-1)^i*binomial(k,i)*i^n)*(-1)^k/k!  \\ M. F. Hasler, Mar 06 2012
    
  • Sage
    stirling_number2 # Danny Rorabaugh, Oct 11 2015
    

Formula

S2(n, k) = k*S2(n-1, k) + S2(n-1, k-1), n > 1. S2(1, k) = 0, k > 1. S2(1, 1) = 1.
E.g.f.: A(x, y) = e^(y*e^x-y). E.g.f. for m-th column: (e^x-1)^m/m!.
S2(n, k) = (1/k!) * Sum_{i=0..k} (-1)^(k-i)*binomial(k, i)*i^n.
Row sums: Bell number A000110(n) = Sum_{k=1..n} S2(n, k), n>0.
S(n, k) = Sum (i_1*i_2*...*i_(n-k)) summed over all (n-k)-combinations {i_1, i_2, ..., i_k} with repetitions of the numbers {1, 2, ..., k}. Also S(n, k) = Sum (1^(r_1)*2^(r_2)*...* k^(r_k)) summed over integers r_j >= 0, for j=1..k, with Sum{j=1..k} r_j = n-k. [Charalambides]. - Wolfdieter Lang, Aug 15 2019.
A019538(n, k) = k! * S2(n, k).
A028248(n, k) = (k-1)! * S2(n, k).
For asymptotics see Hsu (1948), among other sources.
Sum_{n>=0} S2(n, k)*x^n = x^k/((1-x)(1-2x)(1-3x)...(1-kx)).
Let P(n) = the number of integer partitions of n (A000041), p(i) = the number of parts of the i-th partition of n, d(i) = the number of distinct parts of the i-th partition of n, p(j, i) = the j-th part of the i-th partition of n, m(i, j) = multiplicity of the j-th part of the i-th partition of n, and Sum_{i=1..P(n), p(i)=m} = sum running from i=1 to i=P(n) but taking only partitions with p(i)=m parts into account. Then S2(n, m) = Sum_{i=1..P(n), p(i)=m} n!/(Product_{j=1..p(i)} p(i, j)!) * 1/(Product_{j=1..d(i)} m(i, j)!). For example, S2(6, 3) = 90 because n=6 has the following partitions with m=3 parts: (114), (123), (222). Their complexions are: (114): 6!/(1!*1!*4!) * 1/(2!*1!) = 15, (123): 6!/(1!*2!*3!) * 1/(1!*1!*1!) = 60, (222): 6!/(2!*2!*2!) * 1/(3!) = 15. The sum of the complexions is 15+60+15 = 90 = S2(6, 3). - Thomas Wieder, Jun 02 2005
Sum_{k=1..n} k*S2(n,k) = B(n+1)-B(n), where B(q) are the Bell numbers (A000110). - Emeric Deutsch, Nov 01 2006
Recurrence: S2(n+1,k) = Sum_{i=0..n} binomial(n,i)*S2(i,k-1). With the starting conditions S2(n,k) = 1 for n = 0 or k = 1 and S2(n,k) = 0 for k = 0 we have the closely related recurrence S2(n,k) = Sum_{i=k..n} binomial(n-1,i-1)*S2(i-1,k-1). - Thomas Wieder, Jan 27 2007
Representation of Stirling numbers of the second kind S2(n,k), n=1,2,..., k=1,2,...,n, as special values of hypergeometric function of type (n)F(n-1): S2(n,k)= (-1)^(k-1)*hypergeom([ -k+1,2,2,...,2],[1,1,...,1],1)/(k-1)!, i.e., having n parameters in the numerator: one equal to -k+1 and n-1 parameters all equal to 2; and having n-1 parameters in the denominator all equal to 1 and the value of the argument equal to 1. Example: S2(6,k)= seq(evalf((-1)^(k-1)*hypergeom([ -k+1,2,2,2,2,2],[1,1,1,1,1],1)/(k-1)!),k=1..6)=1,31,90,65,15,1. - Karol A. Penson, Mar 28 2007
From Tom Copeland, Oct 10 2007: (Start)
Bell_n(x) = Sum_{j=0..n} S2(n,j) * x^j = Sum_{j=0..n} E(n,j) * Lag(n,-x, j-n) = Sum_{j=0..n} (E(n,j)/n!) * (n!*Lag(n,-x, j-n)) = Sum_{j=0..n} E(n,j) * binomial(Bell.(x)+j, n) umbrally where Bell_n(x) are the Bell / Touchard / exponential polynomials; S2(n,j), the Stirling numbers of the second kind; E(n,j), the Eulerian numbers; and Lag(n,x,m), the associated Laguerre polynomials of order m.
For x = 0, the equation gives Sum_{j=0..n} E(n,j) * binomial(j,n) = 1 for n=0 and 0 for all other n. By substituting the umbral compositional inverse of the Bell polynomials, the lower factorial n!*binomial(y,n), for x in the equation, the Worpitzky identity is obtained; y^n = Sum_{j=0..n} E(n,j) * binomial(y+j,n).
Note that E(n,j)/n! = E(n,j)/(Sum_{k=0..n}E(n,k)). Also (n!*Lag(n, -1, j-n)) is A086885 with a simple combinatorial interpretation in terms of seating arrangements, giving a combinatorial interpretation to the equation for x=1; n!*Bell_n(1) = n!*Sum_{j=0..n} S2(n,j) = Sum_{j=0..n} E(n,j) * (n!*Lag(n, -1, j-n)).
(Appended Sep 16 2020) For connections to the Bernoulli numbers, extensions, proofs, and a clear presentation of the number arrays involved in the identities above, see my post Reciprocity and Umbral Witchcraft. (End)
n-th row = leftmost column of nonzero terms of A127701^(n-1). Also, (n+1)-th row of the triangle = A127701 * n-th row; deleting the zeros. Example: A127701 * [1, 3, 1, 0, 0, 0, ...] = [1, 7, 6, 1, 0, 0, 0, ...]. - Gary W. Adamson, Nov 21 2007
The row polynomials are given by D^n(e^(x*t)) evaluated at x = 0, where D is the operator (1+x)*d/dx. Cf. A147315 and A094198. See also A185422. - Peter Bala, Nov 25 2011
Let f(x) = e^(e^x). Then for n >= 1, 1/f(x)*(d/dx)^n(f(x)) = 1/f(x)*(d/dx)^(n-1)(e^x*f(x)) = Sum_{k=1..n} S2(n,k)*e^(k*x). Similar formulas hold for A039755, A105794, A111577, A143494 and A154537. - Peter Bala, Mar 01 2012
S2(n,k) = A048993(n,k), 1 <= k <= n. - Reinhard Zumkeller, Mar 26 2012
O.g.f. for the n-th diagonal is D^n(x), where D is the operator x/(1-x)*d/dx. - Peter Bala, Jul 02 2012
n*i!*S2(n-1,i) = Sum_{j=(i+1)..n} (-1)^(j-i+1)*j!/(j-i)*S2(n,j). - Leonid Bedratyuk, Aug 19 2012
G.f.: (1/Q(0)-1)/(x*y), where Q(k) = 1 - (y+k)*x - (k+1)*y*x^2/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Nov 09 2013
From Tom Copeland, Apr 17 2014: (Start)
Multiply each n-th diagonal of the Pascal lower triangular matrix by x^n and designate the result as A007318(x) = P(x).
With Bell(n,x)=B(n,x) defined above, D = d/dx, and :xD:^n = x^n*D^n, a Dobinski formula gives umbrally f(y)^B(.,x) = e^(-x)*e^(f(y)*x). Then f(y)^B(.,:xD:)g(x) = [f(y)^(xD)]g(x) = e^[-(1-f(y)):xD:]g(x) = g[f(y)x].
In particular, for f(y) = (1+y),
A) (1+y)^B(.,x) = e^(-x)*e^((1+y)*x) = e^(x*y) = e^[log(1+y)B(.,x)],
B) (I+dP)^B(.,x) = e^(x*dP) = P(x) = e^[x*(e^M-I)]= e^[M*B(.,x)] with dP = A132440, M = A238385-I = log(I+dP), and I = identity matrix, and
C) (1+dP)^(xD) = e^(dP:xD:) = P(:xD:) = e^[(e^M-I):xD:] = e^[M*xD] with action e^(dP:xD:)g(x) = g[(I+dP)*x].
D) P(x)^m = P(m*x), which implies (Sum_{k=1..m} a_k)^j = B(j,m*x) where the sum is umbrally evaluated only after exponentiation with (a_k)^q = B(.,x)^q = B(q,x). E.g., (a1+a2+a3)^2=a1^2+a2^2+a3^2+2(a1*a2+a1*a3+a2*a3) = 3*B(2,x)+6*B(1,x)^2 = 9x^2+3x = B(2,3x).
E) P(x)^2 = P(2x) = e^[M*B(.,2x)] = A038207(x), the face vectors of the n-Dim hypercubes.
(End)
As a matrix equivalent of some inversions mentioned above, A008277*A008275 = I, the identity matrix, regarded as lower triangular matrices. - Tom Copeland, Apr 26 2014
O.g.f. for the n-th diagonal of the triangle (n = 0,1,2,...): Sum_{k>=0} k^(k+n)*(x*e^(-x))^k/k!. Cf. the generating functions of the diagonals of A039755. Also cf. A112492. - Peter Bala, Jun 22 2014
Floor(1/(-1 + Sum_{n>=k} 1/S2(n,k))) = A034856(k-1), for k>=2. The fractional portion goes to zero at large k. - Richard R. Forberg, Jan 17 2015
From Daniel Forgues, Jan 16 2016: (Start)
Let x_(n), called a factorial term (Boole, 1970) or a factorial polynomial (Elaydi, 2005: p. 60), denote the falling factorial Product_{k=0..n-1} (x-k). Then, for n >= 1, x_(n) = Sum_{k=1..n} A008275(n,k) * x^k, x^n = Sum_{k=1..n} T(n,k) * x_(k), where A008275(n,k) are Stirling numbers of the first kind.
For n >= 1, the row sums yield the exponential numbers (or Bell numbers): Sum_{k=1..n} T(n,k) = A000110(n), and Sum_{k=1..n} (-1)^(n+k) * T(n,k) = (-1)^n * Sum_{k=1..n} (-1)^k * T(n,k) = (-1)^n * A000587(n), where A000587 are the complementary Bell numbers. (End)
Sum_{k=1..n} k*S2(n,k) = A138378(n). - Alois P. Heinz, Jan 07 2022
O.g.f. for the m-th column: x^m/(Product_{j=1..m} 1-j*x). - Daniel Checa, Aug 25 2022
S2(n,k) ~ (k^n)/k!, for fixed k as n->oo. - Daniel Checa, Nov 08 2022
S2(2n+k, n) ~ (2^(2n+k-1/2) * n^(n+k-1/2)) / (sqrt(Pi*(1-c)) * exp(n) * c^n * (2-c)^(n+k)), where c = -LambertW(-2 * exp(-2)). - Miko Labalan, Dec 21 2024
From Mikhail Kurkov, Mar 05 2025: (Start)
For a general proof of the formulas below via generating functions, see Mathematics Stack Exchange link.
Recursion for the n-th row (independently of other rows): T(n,k) = 1/(n-k)*Sum_{j=2..n-k+1} (j-2)!*binomial(-k,j)*T(n,k+j-1) for 1 <= k < n with T(n,n) = 1 (see Fedor Petrov link).
Recursion for the k-th column (independently of other columns): T(n,k) = 1/(n-k)*Sum_{j=2..n-k+1} binomial(n,j)*T(n-j+1,k)*(-1)^j for 1 <= k < n with T(n,n) = 1. (End)

A000111 Euler or up/down numbers: e.g.f. sec(x) + tan(x). Also for n >= 2, half the number of alternating permutations on n letters (A001250).

Original entry on oeis.org

1, 1, 1, 2, 5, 16, 61, 272, 1385, 7936, 50521, 353792, 2702765, 22368256, 199360981, 1903757312, 19391512145, 209865342976, 2404879675441, 29088885112832, 370371188237525, 4951498053124096, 69348874393137901, 1015423886506852352, 15514534163557086905, 246921480190207983616, 4087072509293123892361
Offset: 0

Views

Author

Keywords

Comments

Number of linear extensions of the "zig-zag" poset. See ch. 3, prob. 23 of Stanley. - Mitch Harris, Dec 27 2005
Number of increasing 0-1-2 trees on n vertices. - David Callan, Dec 22 2006
Also the number of refinements of partitions. - Heinz-Richard Halder (halder.bichl(AT)t-online.de), Mar 07 2008
The ratio a(n)/n! is also the probability that n numbers x1,x2,...,xn randomly chosen uniformly and independently in [0,1] satisfy x1 > x2 < x3 > x4 < ... xn. - Pietro Majer, Jul 13 2009
For n >= 2, a(n-2) = number of permutations w of an ordered n-set {x_1 < ... x_n} with the following properties: w(1) = x_n, w(n) = x_{n-1}, w(2) > w(n-1), and neither any subword of w, nor its reversal, has the first three properties. The count is unchanged if the third condition is replaced with w(2) < w(n-1). - Jeremy L. Martin, Mar 26 2010
A partition of zigzag permutations of order n+1 by the smallest or the largest, whichever is behind. This partition has the same recurrent relation as increasing 1-2 trees of order n, by induction the bijection follows. - Wenjin Woan, May 06 2011
As can be seen from the asymptotics given in the FORMULA section, one has lim_{n->oo} 2*n*a(n-1)/a(n) = Pi; see A132049/A132050 for the simplified fractions. - M. F. Hasler, Apr 03 2013
a(n+1) is the sum of row n in triangle A008280. - Reinhard Zumkeller, Nov 05 2013
M. Josuat-Verges, J.-C. Novelli and J.-Y. Thibon (2011) give a far-reaching generalization of the bijection between Euler numbers and alternating permutations. - N. J. A. Sloane, Jul 09 2015
Number of treeshelves avoiding pattern T321. Treeshelves are ordered binary (0-1-2) increasing trees where every child is connected to its parent by a left or a right link, see A278678 for more definitions and examples. - Sergey Kirgizov, Dec 24 2016
Number of sequences (e(1), ..., e(n-1)), 0 <= e(i) < i, such that no three terms are equal. [Theorem 7 of Corteel, Martinez, Savage, and Weselcouch] - Eric M. Schmidt, Jul 17 2017
Number of self-dual edge-labeled trees with n vertices under "mind-body" duality. Also number of self-dual rooted edge-labeled trees with n vertices. See my paper linked below. - Nikos Apostolakis, Aug 01 2018
The ratio a(n)/n! is the volume of the convex polyhedron defined as the set of (x_1,...,x_n) in [0,1]^n such that x_i + x_{i+1} <= 1 for every 1 <= i <= n-1; see the solutions by Macdonald and Nelsen to the Amer. Math. Monthly problem referenced below. - Sanjay Ramassamy, Nov 02 2018
Number of total cyclic orders on {0,1,...,n} such that the triple (i-1,i,i+1) is positively oriented for every 1 <= i <= n-1; see my paper on cyclic orders linked below. - Sanjay Ramassamy, Nov 02 2018
The number of binary, rooted, unlabeled histories with n+1 leaves (following the definition of Rosenberg 2006). Also termed Tajima trees, Tajima genealogies, or binary, rooted, unlabeled ranked trees (Palacios et al. 2015). See Disanto & Wiehe (2013) for a proof. - Noah A Rosenberg, Mar 10 2019
From Gus Wiseman, Dec 31 2019: (Start)
Also the number of non-isomorphic balanced reduced multisystems with n + 1 distinct atoms and maximum depth. A balanced reduced multisystem is either a finite multiset, or a multiset partition with at least two parts, not all of which are singletons, of a balanced reduced multisystem. The labeled version is A006472. For example, non-isomorphic representatives of the a(0) = 1 through a(4) = 5 multisystems are (commas elided):
{1} {12} {{1}{23}} {{{1}}{{2}{34}}} {{{{1}}}{{{2}}{{3}{45}}}}
{{{12}}{{3}{4}}} {{{{1}}}{{{23}}{{4}{5}}}}
{{{{1}{2}}}{{{3}}{{45}}}}
{{{{1}{23}}}{{{4}}{{5}}}}
{{{{12}}}{{{3}}{{4}{5}}}}
Also the number of balanced reduced multisystems with n + 1 equal atoms and maximum depth. This is possibly the meaning of Heinz-Richard Halder's comment (see also A002846, A213427, A265947). The non-maximum-depth version is A318813. For example, the a(0) = 1 through a(4) = 5 multisystems are (commas elided):
{1} {11} {{1}{11}} {{{1}}{{1}{11}}} {{{{1}}}{{{1}}{{1}{11}}}}
{{{11}}{{1}{1}}} {{{{1}}}{{{11}}{{1}{1}}}}
{{{{1}{1}}}{{{1}}{{11}}}}
{{{{1}{11}}}{{{1}}{{1}}}}
{{{{11}}}{{{1}}{{1}{1}}}}
(End)
With s_n denoting the sum of n independent uniformly random numbers chosen from [-1/2,1/2], the probability that the closest integer to s_n is even is exactly 1/2 + a(n)/(2*n!). (See Hambardzumyan et al. 2023, Appendix B.) - Suhail Sherif, Mar 31 2024
The number of permutations of size n+1 that require exactly n passes through a stack (i.e. have reverse-tier n-1) with an algorithm that prioritizes outputting the maximum possible prefix of the identity in a given pass and reverses the remainder of the permutation for prior to the next pass. - Rebecca Smith, Jun 05 2024

Examples

			G.f. = 1 + x + x^2 + 2*x^3 + 5*x^4 + 16*x^5 + 61*x^6 + 272*x^7 + 1385*x^8 + ...
Sequence starts 1,1,2,5,16,... since possibilities are {}, {A}, {AB}, {ACB, BCA}, {ACBD, ADBC, BCAD, BDAC, CDAB}, {ACBED, ADBEC, ADCEB, AEBDC, AECDB, BCAED, BDAEC, BDCEA, BEADC, BECDA, CDAEB, CDBEA, CEADB, CEBDA, DEACB, DEBCA}, etc. - _Henry Bottomley_, Jan 17 2001
		

References

  • M. D. Atkinson: Partial orders and comparison problems, Sixteenth Southeastern Conference on Combinatorics, Graph Theory and Computing, (Boca Raton, Feb 1985), Congressus Numerantium 47, 77-88.
  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, pages 34, 932.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, pp. 258-260, section #11.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 110.
  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262.
  • H. Doerrie, 100 Great Problems of Elementary Mathematics, Dover, NY, 1965, p. 66.
  • O. Heimo and A. Karttunen, Series help-mates in 8, 9 and 10 moves (Problems 2901, 2974-2976), Suomen Tehtavaniekat (Proceedings of the Finnish Chess Problem Society) vol. 60, no. 2/2006, pp. 75, 77.
  • L. B. W. Jolley, Summation of Series. 2nd ed., Dover, NY, 1961, p. 238.
  • S. Mukai, An Introduction to Invariants and Moduli, Cambridge, 2003; see p. 444.
  • E. Netto, Lehrbuch der Combinatorik. 2nd ed., Teubner, Leipzig, 1927, p. 110.
  • C. A. Pickover, The Math Book, Sterling, NY, 2009; see p. 184.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 1, 1997 and Vol. 2, 1999; see Problem 5.7.

Crossrefs

Cf. A000364 (secant numbers), A000182 (tangent numbers).
Cf. A181937 for n-alternating permutations.
Cf. A109449 for an extension to an exponential Riordan array.
Column k=2 of A250261.
For 0-1-2 trees with n nodes and k leaves, see A301344.
Matula-Goebel numbers of 0-1-2 trees are A292050.
An overview over generalized Euler numbers gives A349264.

Programs

  • Haskell
    a000111 0 = 1
    a000111 n = sum $ a008280_row (n - 1)
    -- Reinhard Zumkeller, Nov 01 2013
    
  • Maple
    A000111 := n-> n!*coeff(series(sec(x)+tan(x),x,n+1), x, n);
    s := series(sec(x)+tan(x), x, 100): A000111 := n-> n!*coeff(s, x, n);
    A000111:=n->piecewise(n mod 2=1,(-1)^((n-1)/2)*2^(n+1)*(2^(n+1)-1)*bernoulli(n+1)/(n+1),(-1)^(n/2)*euler(n)):seq(A000111(n),n=0..30); A000111:=proc(n) local k: k:=floor((n+1)/2): if n mod 2=1 then RETURN((-1)^(k-1)*2^(2*k)*(2^(2*k)-1)*bernoulli(2*k)/(2*k)) else RETURN((-1)^k*euler(2*k)) fi: end:seq(A000111(n),n=0..30); (C. Ronaldo)
    T := n -> 2^n*abs(euler(n,1/2)+euler(n,1)): # Peter Luschny, Jan 25 2009
    S := proc(n,k) option remember; if k=0 then RETURN(`if`(n=0,1,0)) fi; S(n,k-1)+S(n-1,n-k) end:
    A000364 := n -> S(2*n,2*n);
    A000182 := n -> S(2*n+1,2*n+1);
    A000111 := n -> S(n,n); # Peter Luschny, Jul 29 2009
    a := n -> 2^(n+2)*n!*(sum(1/(4*k+1)^(n+1), k = -infinity..infinity))/Pi^(n+1):
    1, seq(a(n), n = 1..22); # Emeric Deutsch, Aug 17 2009
    # alternative Maple program:
    b:= proc(u, o) option remember;
          `if`(u+o=0, 1, add(b(o-1+j, u-j), j=1..u))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..30);  # Alois P. Heinz, Nov 29 2015
  • Mathematica
    n=22; CoefficientList[Series[(1+Sin[x])/Cos[x], {x, 0, n}], x] * Table[k!, {k, 0, n}] (* Jean-François Alcover, May 18 2011, after Michael Somos *)
    a[n_] := If[EvenQ[n], Abs[EulerE[n]], Abs[(2^(n+1)*(2^(n+1)-1)*BernoulliB[n+1])/(n+1)]]; Table[a[n], {n, 0, 26}] (* Jean-François Alcover, Oct 09 2012, after C. Ronaldo *)
    ee = Table[ 2^n*EulerE[n, 1] + EulerE[n] - 1, {n, 0, 26}]; Table[ Differences[ee, n] // First // Abs, {n, 0, 26}] (* Jean-François Alcover, Mar 21 2013, after Paul Curtz *)
    a[ n_] := If[ n < 0, 0, (2 I)^n If[ EvenQ[n], EulerE[n, 1/2], EulerE[n, 0] I]]; (* Michael Somos, Aug 15 2015 *)
    a[ n_] := If[ n < 1, Boole[n == 0], With[{m = n - 1}, m! SeriesCoefficient[ 1 / (1 - Sin[x]), {x, 0, m}]]]; (* Michael Somos, Aug 15 2015 *)
    s[0] = 1; s[] = 0; t[n, 0] := s[n]; t[n_, k_] := t[n, k] = t[n, k-1] + t[n-1, n-k]; a[n_] := t[n, n]; Array[a, 30, 0](* Jean-François Alcover, Feb 12 2016 *)
    a[n_] := If[n == 0, 1, 2*Abs[PolyLog[-n, I]]]; (* Jean-François Alcover, Dec 02 2023, after M. F. Hasler *)
    a[0] := 1; a[1] := 1; a[n_] := a[n] = Sum[Binomial[n - 2, k] a[k] a[n - 1 - k], {k, 0, n - 2}]; Map[a, Range[0, 26]] (* Oliver Seipel, May 24 2024 after Peter Bala *)
    a[0] := 1; a[1] := 1; a[n_] := a[n] = 1/(n (n-1)) Sum[a[n-1-k] a[k] k, {k, 1, n-1}]; Map[#! a[#]&, Range[0, 26]] (* Oliver Seipel, May 27 2024 *)
  • Maxima
    a(n):=sum((if evenp(n+k) then (-1)^((n+k)/2)*sum(j!*stirling2(n,j)*2^(1-j)*(-1)^(n+j-k)*binomial(j-1,k-1),j,k,n) else 0),k,1,n); /* Vladimir Kruchinin, Aug 19 2010 */
    
  • Maxima
    a(n):=if n<2 then 1 else 2*sum(4^m*(sum((i-(n-1)/2)^(n-1)*binomial(n-2*m-1,i-m)*(-1)^(n-i-1),i,m,(n-1)/2)),m,0,(n-2)/2); /* Vladimir Kruchinin, Aug 09 2011 */
    
  • PARI
    {a(n) = if( n<1, n==0, n--; n! * polcoeff( 1 / (1 - sin(x + x * O(x^n))), n))}; \\ Michael Somos, Feb 03 2004
    
  • PARI
    {a(n) = local(v=[1], t); if( n<0, 0, for(k=2, n+2, t=0; v = vector(k, i, if( i>1, t+= v[k+1-i]))); v[2])}; \\ Michael Somos, Feb 03 2004
    
  • PARI
    {a(n) = local(an); if( n<1, n>=0, an = vector(n+1, m, 1); for( m=2, n, an[m+1] = sum( k=0, m-1, binomial(m-1, k) * an[k+1] * an[m-k]) / 2); an[n+1])}; \\ Michael Somos, Feb 03 2004
    
  • PARI
    z='z+O('z^66); egf = (1+sin(z))/cos(z); Vec(serlaplace(egf)) \\ Joerg Arndt, Apr 30 2011
    
  • PARI
    A000111(n)={my(k);sum(m=0,n\2,(-1)^m*sum(j=0,k=n+1-2*m,binomial(k,j)*(-1)^j*(k-2*j)^(n+1))/k>>k)}  \\ M. F. Hasler, May 19 2012
    
  • PARI
    A000111(n)=if(n,2*abs(polylog(-n,I)),1)  \\ M. F. Hasler, May 20 2012
    
  • Python
    # requires python 3.2 or higher
    from itertools import accumulate
    A000111_list, blist = [1,1], [1]
    for n in range(10**2):
        blist = list(reversed(list(accumulate(reversed(blist))))) + [0] if n % 2 else [0]+list(accumulate(blist))
        A000111_list.append(sum(blist)) # Chai Wah Wu, Jan 29 2015
    
  • Python
    from mpmath import *
    mp.dps = 150
    l = chop(taylor(lambda x: sec(x) + tan(x), 0, 26))
    [int(fac(i) * li) for i, li in enumerate(l)]  # Indranil Ghosh, Jul 06 2017
    
  • Python
    from sympy import bernoulli, euler
    def A000111(n): return abs(((1<Chai Wah Wu, Nov 13 2024
  • Sage
    # Algorithm of L. Seidel (1877)
    def A000111_list(n) :
        R = []; A = {-1:0, 0:1}; k = 0; e = 1
        for i in (0..n) :
            Am = 0; A[k + e] = 0; e = -e
            for j in (0..i) : Am += A[k]; A[k] = Am; k += e
            R.append(Am)
        return R
    A000111_list(22) # Peter Luschny, Mar 31 2012 (revised Apr 24 2016)
    

Formula

E.g.f.: (1+sin(x))/cos(x) = tan(x) + sec(x).
E.g.f. for a(n+1) is 1/(cos(x/2) - sin(x/2))^2 = 1/(1-sin(x)) = d/dx(sec(x) + tan(x)).
E.g.f. A(x) = -log(1-sin(x)), for a(n+1). - Vladimir Kruchinin, Aug 09 2010
O.g.f.: A(x) = 1+x/(1-x-x^2/(1-2*x-3*x^2/(1-3*x-6*x^2/(1-4*x-10*x^2/(1-... -n*x-(n*(n+1)/2)*x^2/(1- ...)))))) (continued fraction). - Paul D. Hanna, Jan 17 2006
E.g.f. A(x) = y satisfies 2y' = 1 + y^2. - Michael Somos, Feb 03 2004
a(n) = P_n(0) + Q_n(0) (see A155100 and A104035), defining Q_{-1} = 0. Cf. A156142.
2*a(n+1) = Sum_{k=0..n} binomial(n, k)*a(k)*a(n-k).
Asymptotics: a(n) ~ 2^(n+2)*n!/Pi^(n+1). For a proof, see for example Flajolet and Sedgewick.
a(n) = (n-1)*a(n-1) - Sum_{i=2..n-2} (i-1)*E(n-2, n-1-i), where E are the Entringer numbers A008281. - Jon Perry, Jun 09 2003
a(2*k) = (-1)^k euler(2k) and a(2k-1) = (-1)^(k-1)2^(2k)(2^(2k)-1) Bernoulli(2k)/(2k). - C. Ronaldo (aga_new_ac(AT)hotmail.com), Jan 17 2005
|a(n+1) - 2*a(n)| = A000708(n). - Philippe Deléham, Jan 13 2007
a(n) = 2^n|E(n,1/2) + E(n,1)| where E(n,x) are the Euler polynomials. - Peter Luschny, Jan 25 2009
a(n) = 2^(n+2)*n!*S(n+1)/(Pi)^(n+1), where S(n) = Sum_{k = -inf..inf} 1/(4k+1)^n (see the Elkies reference). - Emeric Deutsch, Aug 17 2009
a(n) = i^(n+1) Sum_{k=1..n+1} Sum_{j=0..k} binomial(k,j)(-1)^j (k-2j)^(n+1) (2i)^(-k) k^{-1}. - Ross Tang (ph.tchaa(AT)gmail.com), Jul 28 2010
a(n) = sum((if evenp(n+k) then (-1)^((n+k)/2)*sum(j!*Stirling2(n,j)*2^(1-j)*(-1)^(n+j-k)*binomial(j-1,k-1),j,k,n) else 0),k,1,n), n>0. - Vladimir Kruchinin, Aug 19 2010
If n==1(mod 4) is prime, then a(n)==1(mod n); if n==3(mod 4) is prime, then a(n)==-1(mod n). - Vladimir Shevelev, Aug 31 2010
For m>=0, a(2^m)==1(mod 2^m); If p is prime, then a(2*p)==1(mod 2*p). - Vladimir Shevelev, Sep 03 2010
From Peter Bala, Jan 26 2011: (Start)
a(n) = A(n,i)/(1+i)^(n-1), where i = sqrt(-1) and {A(n,x)}n>=1 = [1,1+x,1+4*x+x^2,1+11*x+11*x^2+x^3,...] denotes the sequence of Eulerian polynomials.
Equivalently, a(n) = i^(n+1)*Sum_{k=1..n} (-1)^k*k!*Stirling2(n,k) * ((1+i)/2)^(k-1) = i^(n+1)*Sum_{k = 1..n} (-1)^k*((1+i)/2)^(k-1)* Sum_{j = 0..k} (-1)^(k-j)*binomial(k,j)*j^n.
This explicit formula for a(n) can be used to obtain congruence results. For example, for odd prime p, a(p) = (-1)^((p-1)/2) (mod p), as noted by Vladimir Shevelev above.
For the corresponding type B results see A001586. For the corresponding results for plane increasing 0-1-2 trees see A080635.
For generalized Eulerian, Stirling and Bernoulli numbers associated with the zigzag numbers see A145876, A147315 and A185424, respectively. For a recursive triangle to calculate a(n) see A185414.
(End)
a(n) = I^(n+1)*2*Li_{-n}(-I) for n > 0. Li_{s}(z) is the polylogarithm. - Peter Luschny, Jul 29 2011
a(n) = 2*Sum_{m=0..(n-2)/2} 4^m*(Sum_{i=m..(n-1)/2} (i-(n-1)/2)^(n-1)*binomial(n-2*m-1,i-m)*(-1)^(n-i-1)), n > 1, a(0)=1, a(1)=1. - Vladimir Kruchinin, Aug 09 2011
a(n) = D^(n-1)(1/(1-x)) evaluated at x = 0, where D is the operator sqrt(1-x^2)*d/dx. Cf. A006154. a(n) equals the alternating sum of the nonzero elements of row n-1 of A196776. This leads to a combinatorial interpretation for a(n); for example, a(4*n+2) gives the number of ordered set partitions of 4*n+1 into k odd-sized blocks, k = 1 (mod 4), minus the number of ordered set partitions of 4*n+1 into k odd-sized blocks, k = 3 (mod 4). Cf A002017. - Peter Bala, Dec 06 2011
From Sergei N. Gladkovskii, Nov 14 2011 - Dec 23 2013: (Start)
Continued fractions:
E.g.f.: tan(x) + sec(x) = 1 + x/U(0); U(k) = 4k+1-x/(2-x/(4k+3+x/(2+x/U(k+1)))).
E.g.f.: for a(n+1) is E(x) = 1/(1-sin(x)) = 1 + x/(1 - x + x^2/G(0)); G(k) = (2*k+2)*(2*k+3)-x^2+(2*k+2)*(2*k+3)*x^2/G(k+1).
E.g.f.: for a(n+1) is E(x) = 1/(1-sin(x)) = 1/(1 - x/(1 + x^2/G(0))) ; G(k) = 8*k+6-x^2/(1 + (2*k+2)*(2*k+3)/G(k+1)).
E.g.f.: for a(n+1) is E(x) = 1/(1 - sin(x)) = 1/(1 - x*G(0)); G(k) = 1 - x^2/(2*(2*k+1)*(4*k+3) - 2*x^2*(2*k+1)*(4*k+3)/(x^2 - 4*(k+1)*(4*k+5)/G(k+1))).
E.g.f.: for a(n+1) is E(x) = 1/(1 - sin(x)) = 1/(1 - x*G(0)) where G(k)= 1 - x^2/( (2*k+1)*(2*k+3) - (2*k+1)*(2*k+3)^2/(2*k+3 - (2*k+2)/G(k+1))).
E.g.f.: tan(x) + sec(x) = 1 + 2*x/(U(0)-x) where U(k) = 4k+2 - x^2/U(k+1).
E.g.f.: tan(x) + sec(x) = 1 + 2*x/(2*U(0)-x) where U(k) = 4*k+1 - x^2/(16*k+12 - x^2/U(k+1)).
E.g.f.: tan(x) + sec(x) = 4/(2-x*G(0))-1 where G(k) = 1 - x^2/(x^2 - 4*(2*k+1)*(2*k+3)/G(k+1)).
G.f.: 1 + x/Q(0), m=+4, u=x/2, where Q(k) = 1 - 2*u*(2*k+1) - m*u^2*(k+1)*(2*k+1)/(1 - 2*u*(2*k+2) - m*u^2*(k+1)*(2*k+3)/Q(k+1)).
G.f.: conjecture: 1 + T(0)*x/(1-x), where T(k) = 1 - x^2*(k+1)*(k+2)/(x^2*(k+1)*(k+2) - 2*(1-x*(k+1))*(1-x*(k+2))/T(k+1)).
E.g.f.: 1+ 4*x/(T(0) - 2*x), where T(k) = 4*(2*k+1) - 4*x^2/T(k+1):
E.g.f.: T(0)-1, where T(k) = 2 + x/(4*k+1 - x/(2 - x/( 4*k+3 + x/T(k+1)))). (End)
E.g.f.: tan(x/2 + Pi/4). - Vaclav Kotesovec, Nov 08 2013
Asymptotic expansion: 4*(2*n/(Pi*e))^(n+1/2)*exp(1/2+1/(12*n) -1/(360*n^3) + 1/(1260*n^5) - ...). (See the Luschny link.) - Peter Luschny, Jul 14 2015
From Peter Bala, Sep 10 2015: (Start)
The e.g.f. A(x) = tan(x) + sec(x) satisfies A''(x) = A(x)*A'(x), hence the recurrence a(0) = 1, a(1) = 1, else a(n) = Sum_{i = 0..n-2} binomial(n-2,i)*a(i)*a(n-1-i).
Note, the same recurrence, but with the initial conditions a(0) = 0 and a(1) = 1, produces the sequence [0,1,0,1,0,4,0,34,0,496,...], an aerated version of A002105. (End)
a(n) = A186365(n)/n for n >= 1. - Anton Zakharov, Aug 23 2016
From Peter Luschny, Oct 27 2017: (Start)
a(n) = abs(2*4^n*(H(((-1)^n - 3)/8, -n) - H(((-1)^n - 7)/8, -n))) where H(z, r) are the generalized harmonic numbers.
a(n) = (-1)^binomial(n + 1, 2)*2^(2*n + 1)*(zeta(-n, 1 + (1/8)*(-7 + (-1)^n)) - zeta(-n, 1 + (1/8)*(-3 + (-1)^n))). (End)
a(n) = i*(i^n*Li_{-n}(-i) - (-i)^n*Li_{-n}(i)), where i is the imaginary unit and Li_{s}(z) is the polylogarithm. - Peter Luschny, Aug 28 2020
Sum_{n>=0} 1/a(n) = A340315. - Amiram Eldar, May 29 2021
a(n) = n!*Re([x^n](1 + I^(n^2 - n)*(2 - 2*I)/(exp(x) + I))). - Peter Luschny, Aug 09 2021

Extensions

Edited by M. F. Hasler, Apr 04 2013
Title corrected by Geoffrey Critzer, May 18 2013

A145876 Triangle read by rows: T(n,k) is the number of permutations of [n] having k-1 alternating descents (1<=k<=n). The index i is an alternating descent of a permutation p if either i is odd and p(i)>p(i+1), or i is even and p(i)

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 5, 7, 7, 5, 16, 26, 36, 26, 16, 61, 117, 182, 182, 117, 61, 272, 594, 1056, 1196, 1056, 594, 272, 1385, 3407, 6669, 8699, 8699, 6669, 3407, 1385, 7936, 21682, 46348, 67054, 76840, 67054, 46348, 21682, 7936, 50521, 151853, 350240, 556952, 704834, 704834, 556952, 350240, 151853, 50521
Offset: 1

Views

Author

Emeric Deutsch, Oct 22 2008

Keywords

Comments

Row sums are the factorials (A000142).
T(n,1) = T(n,n) = A000111(n) (Euler or up-down numbers).
Sum(k*T(n,k), k=1..n) = (n+1)!/2 = A001710(n+1).
From Peter Bala, Jun 11 2011: (Start)
Koutras has defined generalized Eulerian numbers associated with a sequence of polynomials - the ordinary Eulerian numbers A008292 being associated with the sequence of monomials x^n. The present array is the triangle of Eulerian numbers associated with the sequence of zigzag polynomials Z(n,x) defined in A147309.
See A109449, A147315 and A185424 for the respective analogs of the Pascal triangle, the Stirling numbers of the second kind and the Bernoulli numbers, associated with the sequence of zigzag polynomials. (End)
From Vaclav Kotesovec, Apr 29 2018: (Start)
In general, for fixed k>=1, T(n,k) ~ (4-Pi)^(k-1) * 2^(n+2) * n^(k-1) * n! / ((k-1)! * Pi^(n + k)).
Equivalently, for fixed k>=1, T(n,k) ~ (4-Pi)^(k-1) * 2^(n + 5/2) * n^(n + k - 1/2) / ((k-1)! * Pi^(n + k - 1/2) * exp(n)). (End)

Examples

			T(4,3) = 7 because we have 1243, 4123, 1342, 3124, 2134, 2341 and 4321. For example, for p=1342 the alternating descent is {2,3}; indeed, 2 is even and p(2)=3 < p(3)=4, while 3 is odd and p(3)=4 > p(4)=2.
Triangle starts:
     1;
     1,    1;
     2,    2,    2;
     5,    7,    7,    5;
    16,   26,   36,   26,   16;
    61,  117,  182,  182,  117,   61;
   272,  594, 1056, 1196, 1056,  594,  272;
  1385, 3407, 6669, 8699, 8699, 6669, 3407, 1385;
  ...
		

Crossrefs

Cf. A302903 (T(2n+1,n+1)), A302904 (T(2n,n)), A302905 (T(n,ceiling(n/2))).

Programs

  • Maple
    F:=t*(1-tan(u*(t-1))-sec(u*(t-1)))/(tan(u*(t-1))+sec(u*(t-1))-t): Fser:= simplify(series(F,u=0,12)): for n from 0 to 10 do P[n]:=sort(expand(factorial(n)*coeff(Fser,u,n))) end do: for n to 10 do seq(coeff(P[n],t,j),j=1..n) end do; # yields sequence in triangular form
    # second Maple program:
    b:= proc(u, o) option remember; expand(`if`(u+o=0, 1,
           add(b(o+j-1, u-j)*x, j=1..u)+
           add(b(o-j, u-1+j),   j=1..o)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=1..n))(b(n, 0)):
    seq(T(n), n=1..12);  # Alois P. Heinz, Nov 18 2013, Apr 15 2018
  • Mathematica
    b[u_, o_, t_] := b[u, o, t] = If[u+o == 0, 1, Expand[
         Sum[b[u+j-1, o-j, !t]*If[t, 1, x], {j, 1, o}] +
         Sum[b[u-j, o+j-1, !t]*If[t, x, 1], {j, 1, u}]]];
    T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, n-1}]][b[0, n, True]];
    Table[T[n], {n, 1, 12}] // Flatten (* Jean-François Alcover, Feb 19 2015, after Alois P. Heinz *)

Formula

E.g.f.: F(t,u) = t*(1-tan(u*(t-1))-sec(u*(t-1)))/(tan(u*(t-1))+sec(u*(t-1))-t).
From Peter Bala, Jun 11 2011: (Start)
T(n,k) = Sum_{j = 0..k} (-1)^(k-j)*binomial(n+1,k-j)*Z(n,j), where Z(n,x) are the zigzag polynomials defined in A147309.
Let M denote the triangular array A109449. The first column of the array (I-x*M)^-1 is a sequence of rational functions in x whose numerator polynomials are the row polynomials of the present array.
(End)
From Vladimir Shevelev, Jul 01 2011: (Start)
a(2^(2*n-1)-2^(n-1)+1) == 1 (mod 2^n).
If n is odd prime, then a(2*n^2-n+1) == 1 (mod 2*n) and a((n^2-n+2)/2) == (-1)^((n-1)/2).
(End)

A147309 Riordan array [sec(x), log(sec(x) + tan(x))].

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 0, 4, 0, 1, 5, 0, 10, 0, 1, 0, 40, 0, 20, 0, 1, 61, 0, 175, 0, 35, 0, 1, 0, 768, 0, 560, 0, 56, 0, 1, 1385, 0, 4996, 0, 1470, 0, 84, 0, 1, 0, 24320, 0, 22720, 0, 3360, 0, 120, 0, 1
Offset: 0

Views

Author

Paul Barry, Nov 05 2008

Keywords

Comments

Production array is [cosh(x),x] beheaded. Inverse is A147308. Row sums are A000111(n+1).
Unsigned version of A147308. - N. J. A. Sloane, Nov 07 2008
From Peter Bala, Jan 26 2011: (Start)
Define a polynomial sequence {Z(n,x)} n >= 0 by means of the recursion
(1)... Z(n+1,x) = 1/2*x*{Z(n,x-1)+Z(n,x+1)}
with starting condition Z(0,x) = 1. We call Z(n,x) the zigzag polynomial of degree n. This table lists the coefficients of these polynomials (for n >= 1) in ascending powers of x, row indices shifted by 1. The first few polynomials are
... Z(1,x) = x
... Z(2,x) = x^2
... Z(3,x) = x + x^3
... Z(4,x) = 4*x^2 + x^4
... Z(5,x) = 5*x + 10*x^3 + x^5.
The value Z(n,1) equals the zigzag number A000111(n). The polynomials Z(n,x) occur in formulas for the enumeration of permutations by alternating descents A145876 and in the enumeration of forests of non-plane unary binary labeled trees A147315.
{Z(n,x)}n>=0 is a polynomial sequence of binomial type and so is analogous to the sequence of monomials x^n. Denoting Z(n,x) by x^[n] to emphasize this analogy, we have, for example, the following analog of Bernoulli's formula for the sum of integer powers:
(2)... 1^[m]+...+(n-1)^[m] = (1/(m+1))*Sum_{k=0..m} (-1)^floor(k/2)*binomial(m+1,k)*B_k*n^[m+1-k],
where {B_k} k >= 0 = [1, -1/2, 1/6, 0, -1/30, ...] is the sequence of Bernoulli numbers.
For similarly defined polynomial sequences to Z(n,x) see A185415, A185417 and A185419. See also A185424.
(End)
[gd(x)^(-1)]^m = Sum_{n>=m} Tg(n,m)*(m!/n!)*x^n, where gd(x) is Gudermannian function, Tg(n+1,m+1)=T(n,m). - Vladimir Kruchinin, Dec 18 2011
The Bell transform of abs(E(n)), E(n) the Euler numbers. For the definition of the Bell transform see A264428. - Peter Luschny, Jan 18 2016

Examples

			Triangle begins
   1;
   0,  1;
   1,  0,   1;
   0,  4,   0,  1;
   5,  0,  10,  0,  1;
   0, 40,   0, 20,  0, 1;
  61,  0, 175,  0, 35, 0, 1;
		

Crossrefs

Programs

  • Maple
    Z := proc(n, x) option remember;
    description 'zigzag polynomials Z(n, x)'
    if n = 0 return 1 else return 1/2*x*(Z(n-1, x-1)+Z(n-1, x+1)) end proc:
    with(PolynomialTools):
    for n from 1 to 10 CoefficientList(Z(n, x), x); end do; # Peter Bala, Jan 26 2011
  • Mathematica
    t[n_, k_] := SeriesCoefficient[ 2^k*ArcTan[(E^x - 1)/(E^x + 1)]^k*n!/k!, {x, 0, n}]; Table[t[n, k], {n, 1, 10}, {k, 1, n}] // Flatten // Abs (* Jean-François Alcover, Jan 23 2015 *)
  • PARI
    T(n, k)=local(X); if(k<1 || k>n, 0, X=x+x*O(x^n); n!*polcoeff(polcoeff((tan(X)+1/cos(X))^y, n), k)) \\ Paul D. Hanna, Feb 06 2011
    
  • Sage
    R = PolynomialRing(QQ, 'x')
    @CachedFunction
    def zzp(n, x) :
        return 1 if n == 0 else x*(zzp(n-1, x-1)+zzp(n-1, x+1))/2
    def A147309_row(n) :
        x = R.gen()
        L = list(R(zzp(n, x)))
        del L[0]
        return L
    for n in (1..10) : print(A147309_row(n)) # Peter Luschny, Jul 22 2012
    
  • Sage
    # uses[bell_matrix from A264428]
    # Alternative: Adds a column 1,0,0,0, ... at the left side of the triangle.
    bell_matrix(lambda n: abs(euler_number(n)), 10) # Peter Luschny, Jan 18 2016

Formula

From Peter Bala, Jan 26 2011: (Start)
GENERATING FUNCTION
The e.g.f., upon including a constant term of '1', is given by:
(1) F(x,t) = (tan(t) + sec(t))^x = Sum_{n>=0} Z(n,x)*t^n/n! = 1 + x*t + x^2*t^2/2! + (x+x^3)*t^3/3! + ....
Other forms include
(2) F(x,t) = exp(x*arcsinh(tan(t))) = exp(2*x*arctanh(tan(t/2))).
(3) F(x,t) = exp(x*(t + t^3/3! + 5*t^5/5! + 61*t^7/7! + ...)),
where the coefficients [1,1,5,61,...] are the secant or zig numbers A000364.
ROW GENERATING POLYNOMIALS
One easily checks from (1) that
d/dt(F(x,t)) = 1/2*x*(F(x-1,t) + F(x+1,t))
and so the row generating polynomials Z(n,x) satisfy the recurrence relation
(4) Z(n+1,x) = 1/2*x*{Z(n,x-1) + Z(n,x+1)}.
The e.g.f. for the odd-indexed row polynomials is
(5) sinh(x*arcsinh(tan(t))) = Sum_{n>=0} Z(2n+1,x)*t^(2n+1)/(2n+1)!.
The e.g.f. for the even-indexed row polynomials is
(6) cosh(x*arcsinh(tan(t))) = Sum_{n>=0} Z(2n,x)*t^(2n)/(2n)!.
From sinh(2*x) = 2*sinh(x)*cosh(x) we obtain the identity
(7) Z(2n+1,2*x) = 2*Sum_{k=0..n} binomial(2n+1,2k)*Z(2k,x)*Z(2n-2k+1,x).
The zeros of Z(n,x) lie on the imaginary axis (use (4) and adapt the proof given in A185417 for the zeros of the polynomial S(n,x)).
BINOMIAL EXPANSION
The form of the e.g.f. shows that {Z(n,x)} n >= 0 is a sequence of polynomials of binomial type. In particular, we have the expansion
(8) Z(n,x+y) = Sum_{k=0..n} binomial(n,k)*Z(k,x)*Z(n-k,y).
The delta operator D* associated with this binomial type sequence is
(9) D* = D - D^3/3! + 5*D^5/5! - 61*D^7/7! + 1385*D^9/9! - ..., and satisfies
the relation
(10) tan(D*)+sec(D*) = exp(D).
The delta operator D* acts as a lowering operator on the zigzag polynomials:
(11) (D*)Z(n,x) = n*Z(n-1,x).
ANALOG OF THE LITTLE FERMAT THEOREM
For integer x and odd prime p
(12) Z(p,x) = (-1)^((p-1)/2)*x (mod p).
More generally, for k = 1,2,3,...
(13) Z(p+k-1,x) = (-1)^((p-1)/2)*Z(k,x) (mod p).
RELATIONS WITH OTHER SEQUENCES
Row sums [1,1,2,5,16,61,...] are the zigzag numbers A000111(n) for n >= 1.
Column 1 (with 0's omitted) is the sequence of Euler numbers A000364.
A145876(n,k) = Sum_{j=0..k} (-1)^(k-j)*binomial(n+1,k-j)*Z(n,j).
A147315(n-1,k-1) = (1/k!)*Sum_{j=0..k} (-1)^(k-j)*binomial(k,j)*Z(n,j).
A185421(n,k) = Sum_{j=0..k} (-1)^(k-j)*binomial(k,j)*Z(n,j).
A012123(n) = (-i)^n*Z(n,i) where i = sqrt(-1). A012259(n) = 2^n*Z(n,1/2).
(End)
T(n,m) = Sum(i=0..n-m, s(i)/(n-i)!*Sum(k=m..n-i, A147315(n-i,k)*Stirling1(k,m))), m>0, T(n,0) = s(n), s(n)=[1,0,1,0,5,0,61,0,1385,0,50521,...] (see A000364). - Vladimir Kruchinin, Mar 10 2011

A185422 Forests of k increasing plane unary-binary trees on n nodes. Generalized Stirling numbers of the second kind associated with A185415.

Original entry on oeis.org

1, 1, 1, 3, 3, 1, 9, 15, 6, 1, 39, 75, 45, 10, 1, 189, 459, 330, 105, 15, 1, 1107, 3087, 2709, 1050, 210, 21, 1, 7281, 23535, 23814, 11109, 2730, 378, 28, 1, 54351, 197235, 228285, 122850, 36099, 6174, 630, 36, 1
Offset: 1

Views

Author

Peter Bala, Jan 28 2011

Keywords

Comments

An increasing tree is a labeled rooted tree with the property that the sequence of labels along any path starting from the root is increasing.
A080635 enumerates increasing plane (ordered) unary-binary trees with n nodes labeled from the set {1,2,...n}. The entry T(n,k) of the present table counts forests of k increasing plane unary-binary trees having n nodes in total. See below for an example.
The Stirling number of the second kind Stirling2(n,k) counts the partitions of the set [n] set into k blocks. Arranging the elements in each block in ascending numerical order provides an alternative combinatorial interpretation for Stirling2(n,k) as counting forests of k increasing unary trees on n nodes. Thus we may view the present array as generalized Stirling numbers of the second kind (associated with A080635 or with the polynomials P(n,x) of A185415 - see formulas (1) and (2) below).
For a table of ordered forests of increasing plane unary-binary trees see A185423. For the enumeration of forests and ordered forests in the non-plane case see A147315 and A185421.
The Bell transform of A080635(n+1). For the definition of the Bell transform see A264428. - Peter Luschny, Jan 18 2016

Examples

			Triangle begins
n\k|....1......2......3......4......5......6......7
===================================================
..1|....1
..2|....1......1
..3|....3......3......1
..4|....9.....15......6......1
..5|...39.....75.....45.....10......1
..6|..189....459....330....105.....15......1
..7|.1107...3087...2709...1050....210.....21......1
..
Examples of the recurrence:
T(5,1) = 39 = T(4,0)+1*T(4,1)+2*T(4,2) = 1*9+2*15;
T(6,3) = 330 = T(5,2)+3*T(5,3)+3*4*T(5,4) = 75+3*45+12*10.
Examples of forests:
T(4,1) = 9. The 9 plane increasing unary-binary trees on 4 nodes are shown in the example section of A080635.
T(4,2) = 15. The 15 forests consisting of two plane increasing unary-binary trees on 4 nodes consist of the 12 forests
......... ......... ...3.....
.2...3... .3...2... ...|.....
..\./.... ..\./.... ...2.....
...1...4. ...1...4. ...|.....
......... ......... ...1...4.
.
......... ......... ...4.....
.2...4... .4...2... ...|.....
..\./.... ..\./.... ...2.....
...1...3. ...1...3. ...|.....
......... ......... ...1...3.
.
......... ......... ...4.....
.3...4... .4...3... ...|.....
..\./.... ..\./.... ...3.....
...1...2. ...1...2. ...|.....
......... ......... ...1...2.
......... ......... ...4.....
.3...4... .4...3... ...|.....
..\./.... ..\./.... ...3.....
...2...1. ...2...1. ...|.....
......... ......... ...2...1.
.
and the three remaining forests
......... ......... ..........
..2..4... ..3..4... ..4...3...
..|..|... ..|..|... ..|...|...
..1..3... ..1..2... ..1...2...
......... ......... ..........
		

References

  • F. Bergeron, Ph. Flajolet and B. Salvy, Varieties of Increasing Trees, in Lecture Notes in Computer Science vol. 581, ed. J.-C. Raoult, Springer 1922, pp. 24-48.

Crossrefs

Programs

  • Maple
    #A185422
    P := proc(n,x)
    description 'polynomial sequence P(n,x) A185415'
    if n = 0
    return 1
    else
    return x*(P(n-1,x-1)-P(n-1,x)+P(n-1,x+1))
    end proc:
    with combinat:
    T:= (n,k) -> 1/k!*add ((-1)^(k-j)*binomial(k,j)*P(n,j),j = 0..k):
    for n from 1 to 10 do
    seq(T(n,k),k = 1..n);
    end do;
  • Mathematica
    t[n_, k_] := t[n, k] = t[n-1, k-1] + k*t[n-1, k] + k*(k+1)*t[n-1, k+1]; t[n_, n_] = 1; t[n_, k_] /; Not[1 <= k <= n] = 0; Table[t[n, k], {n, 1, 9}, {k, 1, n}] // Flatten (* Jean-François Alcover, Nov 22 2012, from given recurrence *)
  • PARI
    {T(n,k)=if(n<1||k<1||k>n,0,if(n==k,1,T(n-1,k-1)+k*T(n-1,k)+k*(k+1)*T(n-1,k+1)))}
    
  • PARI
    {T(n,k)=round(n!*polcoeff(polcoeff(exp(y*(-1/2+sqrt(3)/2*tan(sqrt(3)/2*x+Pi/6+x*O(x^n)))+y*O(y^k)),n,x),k,y))}
    
  • Sage
    # uses[bell_matrix from A264428]
    # Adds a column 1,0,0,0, ... at the left side of the triangle.
    bell_matrix(lambda n: A080635(n+1), 10) # Peter Luschny, Jan 18 2016

Formula

TABLE ENTRIES
(1)... T(n,k) = (1/k!)*Sum_{j=0..k} (-1)^(k-j)*binomial(k,j)*P(n,j),
where P(n,x) are the polynomials described in A185415.
Compare (1) with the formula for the Stirling numbers of the second kind
(2)... Stirling2(n,k) = 1/k!*Sum_{j=0..k} (-1)^(k-j)*binomial(k,j)*j^n.
RECURRENCE RELATION
(3)... T(n+1,k) = T(n,k-1) + k*T(n,k) + k*(k+1)*T(n,k+1).
GENERATING FUNCTION
Let E(t) = 1/2 + sqrt(3)/2*tan(sqrt(3)/2*t + Pi/6) be the e.g.f. for A080635.
The e.g.f. for the present triangle is
(4)... exp{x*(E(t)-1)} = Sum_{n>=0} R(n,x)*t^n/n!
= 1 + x*t + (x+x^2)*t^2/2! + (3*x+3*x^2+x^3)*t^3/3! + ....
ROW POLYNOMIALS
The row generating polynomials R(n,x) satisfy the recurrence
(5)... R(n+1,x) = x*{R(n,x)+R'(n,x)+R''(n,x)},
where the prime ' indicates differentiation with respect to x.
RELATIONS WITH OTHER SEQUENCES
Column 1 is A080635.
k!*T(n,k) counts ordered forests A185423(n,k).
The row polynomials R(n,x) are given by D^n(exp(x*t)) evaluated at t = 0, where D is the operator (1+t+t^2)*d/dt. Cf. A147315 and A008297. - Peter Bala, Nov 25 2011

A185421 Ordered forests of k increasing unordered trees on the vertex set {1,2,...,n} in which all outdegrees are <= 2.

Original entry on oeis.org

1, 1, 2, 2, 6, 6, 5, 22, 36, 24, 16, 90, 210, 240, 120, 61, 422, 1260, 2040, 1800, 720, 272, 2226, 8106, 16800, 21000, 15120, 5040, 1385, 13102, 56196, 141624, 226800, 231840, 141120, 40320, 7936, 85170, 420330, 1244880, 2421720, 3175200, 2751840, 1451520, 362880
Offset: 1

Views

Author

Peter Bala, Jan 31 2011

Keywords

Comments

An increasing tree is a labeled rooted tree with the property that the sequence of labels along any path starting from the root is increasing. A000111(n) for n >= 0 enumerates increasing unordered trees on the vertex set {1,2,...,n}, rooted at 1, in which all outdegrees are <= 2 (plane unary binary trees in the notation of [Bergeron et al.]).
The entry T(n,k) of the present table counts ordered forests of k such trees having n nodes in total. See below for an example. For unordered forests see A147315. For a table of ordered forests of increasing ordered trees in which all outdegrees are <=2 see A185423.

Examples

			Triangle begins
n\k|....1......2......3......4......5......6......7
===================================================
..1|....1
..2|....1......2
..3|....2......6......6
..4|....5.....22.....36.....24
..5|...16.....90....210....240....120
..6|...61....422...1260...2040...1800....720
..7|..272...2226...8106..16800..21000..15120...5040
..
Examples of recurrence relation for table entries:
T(5,2) = 2*{T(4,1)+T(4,2)+1/2*T(4,3)} = 2*(5+22+18) = 90;
T(6,1) = 1*{T(5,0)+T(5,1)+1/2*T(5,2)} = 16 + 1/2*90 = 61.
Examples of forests:
T(4,2) = 22. The 11 unordered forests consisting of 2 trees on 4 nodes are shown in the example section of A147315. Putting an order on the trees in a forest produces 2!*11 = 22 ordered forests.
		

Crossrefs

Programs

  • Maple
    #A185421 E := t -> sec(t)+tan(t)-1:
    F := (x,t) -> 1/(1-x*E(t)) - 1:
    Fser := series(F(x,t),t=0,12):
    for n from 1 to 7 do
    seq(coeff(n!*coeff(Fser,t,n),x,i),i=1..n) od;
  • Mathematica
    nmax = 9; t[n_ /; n > 0, k_ /; k > 0] := t[n, k] = k*(t[n-1, k-1] + t[n-1, k] + 1/2*t[n-1, k+1]);
    t[1, 1] = 1; t[0, ] = 0; t[, 0] = 0; Flatten[Table[t[n, k], {n, 1, nmax}, {k, 1, n}]]
    (* Jean-François Alcover, Jun 22 2011, after recurrence *)
  • PARI
    {T(n,k)=if(n<1||k<1||k>n,0,if(n==1,1,k*(T(n-1,k-1)+T(n-1,k)+T(n-1,k+1)/2)))}
    
  • PARI
    {T(n,k)=local(X=x+x*O(x^n));n!*polcoeff(polcoeff(1/(1-y*((1+sin(X))/cos(X)-1))-1,n,x),k,y)}

Formula

TABLE ENTRIES
(1)... T(n,k) = k!*A147315(n-1,k-1).
(2)... T(n,k) = Sum_{j = 0..k} (-1)^(k-j)*binomial(k,j)*Z(n,j), where Z(n,x) denotes the zigzag polynomials as described in A147309.
Recurrence relation
(3)... T(n+1,k) = k*{T(n,k-1)+T(n,k)+1/2*T(n,k+1)}.
GENERATING FUNCTION
Let E(t) = sec(t)+tan(t)-1. E(t) is the egf for the enumeration of increasing unordered trees on the vertex set {1,2,...,n}, rooted at 1, in which all outdegrees are <=2 (plane unary binary trees in the notation of [Bergeron et al.]).
The egf of the present array is
(4)... 1/(1-x*E(t)) - 1 = Sum_{n >= 1} R(n,x)*t^n/n! = x*t + x*(1+2*x)*t^2/2! + x*(2+6*x+6*x^2)*t^3/3! + ...
ROW POLYNOMIALS
The row generating polynomials R(n,x) begin.
... R(1,x) = x
... R(2,x) = x*(1+2*x)
... R(3,x) = x*(2+6*x+6*x^2)
... R(4,x) = x*(5+22*x+36*x^2+24*x^3).
The ordered Bell polynomials OB(n,x) are the row polynomials of A019538 given by the formula
(5)... OB(n,x) = Sum_{k = 1..n} k!*Stirling2(n,k)*x^k.
By comparing the e.g.f.s for A019538 and the present table we obtain the surprising identity
(6)... (-i)^(n-1)*OB(n,x)/x = R(n,y)/y, where i = sqrt(-1) and x = i*y + (-1/2+i/2). It follows that the zeros of the polynomial R(n,y)/y lie on the vertical line Re(y) = -1/2 in the complex plane.
RELATIONS WITH OTHER SEQUENCES
(7)... T(n,1) = A000111(n).
Setting y = 0 in (6) yields
(8)... A000111(n) = i^(n+1)*Sum_{k=1..n} (-1)^k*k!*Stirling2(n,k) *((1+i)/2)^(k-1).

Extensions

Maple program corrected by Peter Luschny, Aug 02 2011

A000772 E.g.f. exp(tan(x) + sec(x) - 1).

Original entry on oeis.org

1, 1, 2, 6, 23, 107, 583, 3633, 25444, 197620, 1684295, 15618141, 156453857, 1683050189, 19344093070, 236497985706, 3063827565763, 41916787157011, 603799270943519, 9132945141812301, 144708157060239704, 2396568154933265024, 41403636316192616995
Offset: 0

Views

Author

Keywords

Comments

The number of elevated increasing binary trees. There is no restriction on the outdegree at the root. - Wenjin Woan, Jan 09 2008

Crossrefs

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Rationals(), m); b:=Coefficients(R!(Exp(Tan(x) + Sec(x) - 1))); [Factorial(n-1)*b[n]: n in [1..m]]; // Vincenzo Librandi, Jan 30 2020
  • Maple
    b:= proc(u, o) option remember;
          `if`(u+o=0, 1, add(b(o-1+j, u-j), j=1..u))
        end:
    a:= proc(n) option remember; `if`(n=0, 1, add(
          a(n-j)*binomial(n-1,j-1)*b(j, 0), j=1..n))
        end:
    seq(a(n), n=0..23);  # Alois P. Heinz, May 19 2021
  • Mathematica
    nn = 25; Range[0, nn]! CoefficientList[Series[Exp[Tan[x] + Sec[x] - 1], {x, 0, nn}], x] (* T. D. Noe, Jun 20 2012 *)

Formula

a(n) = Sum_{k=1..n} A147315(n-1,k-1), n>0, a(0)=1. - Vladimir Kruchinin, Mar 10 2011
a(n) = D^n(exp(x)) evaluated at x = 0, where D is the operator (1+x+x^2/2!)*d/dx. Cf. A000110 and A094198. See also A185422. - Peter Bala, Nov 25 2011
a(n) ~ 2^n * exp(2/Pi - 1 + 4*sqrt(n/Pi) - n) * n^(n - 1/4) / Pi^(n + 1/4). - Vaclav Kotesovec, Jan 27 2020

A240559 a(n) = -2^n*(E(n, 1/2) + E(n, 1) + (n mod 2)*2*(E(n+1, 1/2) + E(n+1, 1))), where E(n, x) are the Euler polynomials.

Original entry on oeis.org

0, 0, 1, -3, -5, 45, 61, -1113, -1385, 42585, 50521, -2348973, -2702765, 176992725, 199360981, -17487754833, -19391512145, 2195014332465, 2404879675441, -341282303124693, -370371188237525, 64397376340013805, 69348874393137901, -14499110277050234553
Offset: 0

Views

Author

Peter Luschny, Apr 17 2014

Keywords

Examples

			G.f. = x^2 - 3*x^3 - 5*x^4 + 45*x^5 + 61*x^6 - 1113*x^7 - 1385*x^8 + ...
		

Crossrefs

Programs

  • Maple
    A240559 := proc(n) euler(n,1/2) + euler(n,1); if n mod 2 = 1 then % + 2*(euler(n+1,1/2)+euler(n+1,1)) fi; -2^n*% end: seq(A240559(n),n=0..19);
  • Mathematica
    skp[n_, x_] := Sum[Binomial[n, k]*EulerE[k]*x^(n-k), {k, 0, n}]; skp[n_, x0_?NumericQ] := skp[n, x] /. x -> x0; a[n_] := Sum[(-1)^(n-k)*Binomial[n, k]*(skp[k, 0] + skp[k+1, -1]), {k, 0, n}]; Table[a[n], {n, 0, 23}] (* Jean-François Alcover, Dec 09 2014, after Peter Luschny *)
  • Sage
    # Efficient computation with L. Seidel's boustrophedon transformation.
    def A240559_list(n) :
        A = [0]*(n+1); A[0] = 1; R = [0]
        k = 0; e = 1; x = -1; s = -1
        for i in (0..n):
            Am = 0; A[k + e] = 0; e = -e;
            for j in (0..i): Am += A[k]; A[k] = Am; k += e
            if e == 1: x += 1; s = -s
            v = -A[-x] if e == 1 else A[-x] - A[x]
            if i > 1: R.append(s*v)
        return R
    A240559_list(24)

Formula

a(2*n) = (-1)^(n+1)*A147315(2*n,1) = (-1)^(n+1)*A186370(2*n,2*n) =(-1)^(n+1)*A000364(n) for n>0.
a(2*n+1) = (-1)^n*A147315(2*n+1,2) = (-1)^n*A186370(2*n,2*n-1) = A241242(n).
a(n) = Sum_{k=0..n} (-1)^(n-k)*2^k*binomial(n,k)*(E(k,1/2) + 2*E(k+1,0)) where E(n,x) are the Euler polynomials.
a(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(n,k)*(skp(k,0) + skp(k+1,-1)), where skp(n, x) are the Swiss-Knife polynomials A153641.
a(n) = A239322(n) + A239005(n+1) - A239005(n). - Paul Curtz, Apr 18 2014
E.g.f.: 1 - sech(x) - tanh(x) + sinh(x)*sech(x)^2 = ((exp(-x)-1)*sech(x))^2 / 2. - Sergei N. Gladkovskii, Nov 20 2014
E.g.f.: (1 - sech(x)) * (1 - tanh(x)). - Michael Somos, Nov 22 2014

A241242 a(n) = -2^(2*n+1)*(E(2*n+1, 1/2) + E(2*n+1, 1) + 2*(E(2*n+2, 1/2) + E(2*n+2, 1))), where E(n,x) are the Euler polynomials.

Original entry on oeis.org

0, -3, 45, -1113, 42585, -2348973, 176992725, -17487754833, 2195014332465, -341282303124693, 64397376340013805, -14499110277050234553, 3840151029102915908745, -1182008039799685905580413, 418424709061213506712209285, -168805428822414120140493978273
Offset: 0

Views

Author

Peter Luschny, Apr 17 2014

Keywords

Crossrefs

Programs

  • Maple
    A241242 := proc(n) e := n -> euler(n,1/2) + euler(n,1); -2^(2*n+1)*(e(2*n+1) + 2*e(2*n+2)) end: seq(A241242(n),n=0..15);
  • Mathematica
    Array[-2^(2 # + 1)*(EulerE[2 # + 1, 1/2] + EulerE[2 # + 1, 1] + 2 (EulerE[2 # + 2, 1/2] + EulerE[2 # + 2, 1])) &, 16, 0] (* Michael De Vlieger, May 24 2018 *)

Formula

a(n) = A240559(2*n+1) = (-1)^n*A147315(2*n+1,2) = (-1)^n*A186370(2*n,2*n-1).
a(n) = Sum_{k=0..2*n+1} (-1)^(2*n+1-k)*binomial(2*n+1, k)*2^k*(E(k, 1/2) + 2*E(k+1, 0)) where E(n,x) are the Euler polynomials.
a(n) = Sum_{k=0..2*n+1} (-1)^(2*n+1-k)*binomial(2*n+1, k)*(skp(k, 0) + skp(k+1, -1)), where skp(n, x) are the Swiss-Knife polynomials A153641.
a(n) = Bernoulli(2*n + 2) * 4^(n+1) * (1 - 4^(n+1)) / (2*n + 2) - EulerE(2*n + 2), where EulerE(2*n) is A028296. - Daniel Suteu, May 22 2018
a(n) = (-1)^(n+1) * (A000182(n+1) - A000364(n+1)). - Daniel Suteu, Jun 23 2018

A147312 Riordan array [1,log(sec(x)+tan(x))].

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 4, 0, 1, 0, 5, 0, 10, 0, 1, 0, 0, 40, 0, 20, 0, 1, 0, 61, 0, 175, 0, 35, 0, 1, 0, 0, 768, 0, 560, 0, 56, 0, 1, 0, 1385, 0, 4996, 0, 1470, 0, 84, 0, 1, 0, 0, 24320, 0, 22720, 0, 3360, 0, 120, 0, 1, 0, 50521, 0, 214445, 0, 81730, 0, 6930, 0, 165, 0, 1
Offset: 0

Views

Author

Paul Barry, Nov 05 2008

Keywords

Comments

Row sums are A000111. Inverse is A147311.
Production array is [cosh(x),x] with a column of 0's prepended.
The product [sec(x),x]*A147312 is A147309.
Apart from signs, same as A147311. - N. J. A. Sloane, Nov 07 2008
Also the Bell transform of the absolute Euler numbers. For the definition of the Bell transform see A264428. - Peter Luschny, Jan 29 2016

Examples

			Triangle begins
1,
0, 1,
0, 0, 1,
0, 1, 0, 1,
0, 0, 4, 0, 1,
0, 5, 0, 10, 0, 1,
0, 0, 40, 0, 20, 0, 1
		

Programs

  • Maple
    # The function BellMatrix is defined in A264428.
    BellMatrix(n -> abs(euler(n)), 10); # Peter Luschny, Jan 29 2016
  • Mathematica
    BellMatrix[f_, len_] := With[{t = Array[f, len, 0]}, Table[BellY[n, k, t], {n, 0, len - 1}, {k, 0, len - 1}]];
    rows = 12;
    B = BellMatrix[Abs[EulerE[#]] &, rows];
    Table[B[[n, k]], {n, 1, rows}, {k, 1, n}] // Flatten (* Jean-François Alcover, Jun 28 2018, after Peter Luschny *)

Formula

T(n,m)=sum(k=m..n, A147315(n,k)*stirling1(k,m)), n>0,k>0, T(0,0)=1, T(0,k)=0, k>0. [From Vladimir Kruchinin, Mar 10 2011]

Extensions

More terms from Jean-François Alcover, Jun 28 2018
Showing 1-10 of 13 results. Next