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 50 results. Next

A343845 a(n) = Sum_{k=0..floor(n/2)} A109449(n-k, k).

Original entry on oeis.org

1, 1, 2, 4, 9, 27, 93, 392, 1898, 10493, 64885, 443916, 3326317, 27085015, 238073306, 2246348560, 22643042325, 242808804441, 2759740869777, 33138397797908, 419171443909394, 5570771017483187, 77603014042711369, 1130712331125929112, 17198408830271090233
Offset: 0

Views

Author

Peter Luschny, May 06 2021

Keywords

Crossrefs

Cf. A109449.

Programs

  • Maple
    seq(add(A109449(n-k, k), k = 0..n/2), n = 0..25);
  • Mathematica
    Table[Sum[Binomial[n-k,k] * 2^(n-2*k) * Abs[EulerE[n-2*k,1/2] + EulerE[n-2*k,1]], {k,0,Floor[n/2]}] - (1 + (-1)^n)/2, {n,0,25}] (* Vaclav Kotesovec, May 06 2021 *)

Formula

a(n) ~ 2^(n+2) * n! / Pi^(n+1). - Vaclav Kotesovec, May 06 2021

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

A001250 Number of alternating permutations of order n.

Original entry on oeis.org

1, 1, 2, 4, 10, 32, 122, 544, 2770, 15872, 101042, 707584, 5405530, 44736512, 398721962, 3807514624, 38783024290, 419730685952, 4809759350882, 58177770225664, 740742376475050, 9902996106248192, 138697748786275802, 2030847773013704704, 31029068327114173810
Offset: 0

Views

Author

Keywords

Comments

For n>1, a(n) is the number of permutations of order n with the length of longest run equal 2.
Boustrophedon transform of the Euler numbers (A000111). [Berry et al., 2013] - N. J. A. Sloane, Nov 18 2013
Number of inversion sequences of length n where all consecutive subsequences i,j,k satisfy i >= j < k or i < j >= k. a(4) = 10: 0010, 0011, 0020, 0021, 0022, 0101, 0102, 0103, 0112, 0113. - Alois P. Heinz, Oct 16 2019

Examples

			1 + x + 2*x^2 + 4*x^3 + 10*x^4 + 32*x^5 + 122*x^6 + 544*x^7 + 2770*x^8 + ...
From _Gus Wiseman_, Jun 21 2021: (Start)
The a(0) = 1 through a(4) = 10 permutations:
  ()  (1)  (1,2)  (1,3,2)  (1,3,2,4)
           (2,1)  (2,1,3)  (1,4,2,3)
                  (2,3,1)  (2,1,4,3)
                  (3,1,2)  (2,3,1,4)
                           (2,4,1,3)
                           (3,1,4,2)
                           (3,2,4,1)
                           (3,4,1,2)
                           (4,1,3,2)
                           (4,2,3,1)
(End)
		

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 261.
  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 262.
  • 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).

Crossrefs

Cf. A000111. A diagonal of A010094.
The version for permutations of prime indices is A345164.
The version for compositions is A025047, ranked by A345167.
The version for patterns is A345194.
A049774 counts permutations avoiding adjacent (1,2,3).
A344614 counts compositions avoiding adjacent (1,2,3) and (3,2,1).
A344615 counts compositions avoiding the weak adjacent pattern (1,2,3).
A344654 counts partitions without a wiggly permutation, ranked by A344653.
A345170 counts partitions with a wiggly permutation, ranked by A345172.
A345192 counts non-wiggly compositions, ranked by A345168.
Row sums of A104345.

Programs

  • Haskell
    a001250 n = if n == 1 then 1 else 2 * a000111 n
    -- Reinhard Zumkeller, Sep 17 2014
    
  • Maple
    # With Eulerian polynomials:
    A := (n, x) -> `if`(n<2, 1/2/(1+I)^(1-n), add(add((-1)^j*binomial(n+1, j)*(m+1-j)^n, j=0..m)*x^m, m=0..n-1)):
    A001250 := n -> 2*(I-1)^(1-n)*exp(I*(n-1)*Pi/2)*A(n,I);
    seq(A001250(i), i=0..22); # Peter Luschny, May 27 2012
    # second 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-> `if`(n<2, 1, 2)*b(n, 0):
    seq(a(n), n=0..30);  # Alois P. Heinz, Nov 29 2015
  • Mathematica
    a[n_] := 4*Abs[PolyLog[-n, I]]; a[0] = a[1] = 1; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Jan 09 2016, after M. F. Hasler *)
    Table[Length[Select[Permutations[Range[n]],And@@(!(OrderedQ[#]||OrderedQ[Reverse[#]])&/@Partition[#,3,1])&]],{n,8}] (* Gus Wiseman, Jun 21 2021 *)
    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}]; Join[{a[0], a[1]}, Map[2 #! a[#]&, Range[2,24]]] (* Oliver Seipel, May 27 2024 *)
  • PARI
    {a(n) = local(v=[1], t); if( n<0, 0, for( k=2, n+3, t=0; v = vector( k, i, if( i>1, t += v[k+1 - i]))); v[3])} /* Michael Somos, Feb 03 2004 */
    
  • PARI
    {a(n) = if( n<0, 0, n! * polcoeff( (tan(x + x * O(x^n)) + 1 / cos(x + x * O(x^n)))^2, n))} /* Michael Somos, Feb 05 2011 */
    
  • PARI
    A001250(n)=sum(m=0,n\2,my(k);(-1)^m*sum(j=0,k=n+1-2*m,binomial(k,j)*(-1)^j*(k-2*j)^(n+1))/k>>k)*2-(n==1)  \\ M. F. Hasler, May 19 2012
    
  • PARI
    A001250(n)=4*abs(polylog(-n,I))-(n==1)  \\ M. F. Hasler, May 20 2012
    
  • PARI
    my(x='x+O('x^66), egf=1+2*(tan(x)+1/cos(x))-2-x); Vec(serlaplace(egf)) /* Joerg Arndt, May 28 2012 */
    
  • Python
    from itertools import accumulate, islice
    def A001250_gen(): # generator of terms
        yield from (1,1)
        blist = (0,2)
        while True:
            yield (blist := tuple(accumulate(reversed(blist),initial=0)))[-1]
    A001250_list = list(islice(A001250_gen(),40)) # Chai Wah Wu, Jun 09-11 2022
    
  • Python
    from sympy import bernoulli, euler
    def A001250(n): return 1 if n<2 else abs(((1<Chai Wah Wu, Nov 13 2024
  • Sage
    # Algorithm of L. Seidel (1877)
    def A001250_list(n) :
        R = [1]; A = {-1:0, 0:2}; 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
            if i > 1 : R.append(A[-i//2] if i%2 == 0 else A[i//2])
        return R
    A001250_list(22) # Peter Luschny, Mar 31 2012
    

Formula

a(n) = coefficient of x^(n-1)/(n-1)! in power series expansion of (tan(x) + sec(x))^2 = (tan(x)+1/cos(x))^2.
a(n) = coefficient of x^n/n! in power series expansion of 2*(tan(x) + sec(x)) - 2 - x. - Michael Somos, Feb 05 2011
For n>1, a(n) = 2 * A000111(n). - Michael Somos, Mar 19 2011
a(n) = 4*|Li_{-n}(i)| - [n=1] = Sum_{m=0..n/2} (-1)^m*2^(1-k)*Sum_{j=0..k} binomial(k,j)*(-1)^j*(k-2*j)^(n+1)/k - [n=1], where k = k(m) = n+1-2*m and [n=1] equals 1 if n=1 and zero else; Li denotes the polylogarithm (and i^2 = -1). - M. F. Hasler, May 20 2012
From Sergei N. Gladkovskii, Jun 18 2012: (Start)
Let E(x) = 2/(1-sin(x))-1 (essentially the e.g.f.), then
E(x) = -1 + 2*(-1/x + 1/(1-x)/x - x^3/((1-x)*((1-x)*G(0) + x^2))) where G(k) = (2*k+2)*(2*k+3)-x^2+(2*k+2)*(2*k+3)*x^2/G(k+1); (continued fraction, Euler's 1st kind, 1-step).
E(x) = -1 + 2*(-1/x + 1/(1-x)/x - x^3/((1-x)*((1-x)*G(0) + x^2))) where G(k) = 8*k + 6 - x^2/(1 + (2*k+2)*(2*k+3)/G(k+1)); (continued fraction, Euler's 2nd kind, 2-step).
E(x) = (tan(x) + sec(x))^2 = -1 + 2/(1-x*G(0)) where 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))); (continued fraction, 3rd kind, 3-step).
(End)
G.f.: conjecture: 2*T(0)/(1-x) -1, 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))/Q(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Nov 19 2013
a(n) ~ 2^(n+3) * n! / Pi^(n+1). - Vaclav Kotesovec, Sep 06 2014
a(n) = Sum_{k=0..n-1} A109449(n-1,k)*A000111(k). - Reinhard Zumkeller, Sep 17 2014

Extensions

Edited by Max Alekseyev, May 04 2012
a(0)=1 prepended by Alois P. Heinz, Nov 29 2015

A000667 Boustrophedon transform of all-1's sequence.

Original entry on oeis.org

1, 2, 4, 9, 24, 77, 294, 1309, 6664, 38177, 243034, 1701909, 13001604, 107601977, 959021574, 9157981309, 93282431344, 1009552482977, 11568619292914, 139931423833509, 1781662223749884, 23819069385695177, 333601191667149054, 4884673638115922509
Offset: 0

Views

Author

Keywords

Comments

Fill in a triangle, like Pascal's triangle, beginning each row with a 1 and filling in rows alternately right to left and left to right.
Row sums of triangle A109449. - Reinhard Zumkeller, Nov 04 2013

Examples

			...............1..............
............1..->..2..........
.........4..<-.3...<-..1......
......1..->.5..->..8...->..9..
		

Crossrefs

Absolute value of pairwise sums of A009337.
Column k=1 of A292975.

Programs

  • Haskell
    a000667 n = if x == 1 then last xs else x
                where xs@(x:_) = a227862_row n
    -- Reinhard Zumkeller, Nov 01 2013
    
  • Mathematica
    With[{nn=30},CoefficientList[Series[Exp[x](Tan[x]+Sec[x]),{x,0,nn}], x]Range[0,nn]!] (* Harvey P. Dale, Nov 28 2011 *)
    t[, 0] = 1; 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 *)
  • PARI
    x='x+O('x^33); Vec(serlaplace( exp(x)*(tan(x) + 1/cos(x)) ) ) \\ Joerg Arndt, Jul 30 2016
    
  • Python
    from itertools import islice, accumulate
    def A000667_gen(): # generator of terms
        blist = tuple()
        while True:
            yield (blist := tuple(accumulate(reversed(blist),initial=1)))[-1]
    A000667_list = list(islice(A000667_gen(),20)) # Chai Wah Wu, Jun 11 2022
  • Sage
    # Algorithm of L. Seidel (1877)
    def A000667_list(n) :
        R = []; A = {-1:0, 0:0}
        k = 0; e = 1
        for i in range(n) :
            Am = 1
            A[k + e] = 0
            e = -e
            for j in (0..i) :
                Am += A[k]
                A[k] = Am
                k += e
            # print [A[z] for z in (-i//2..i//2)]
            R.append(A[e*i//2])
        return R
    A000667_list(10)  # Peter Luschny, Jun 02 2012
    

Formula

E.g.f.: exp(x) * (tan(x) + sec(x)).
Limit_{n->infinity} 2*n*a(n-1)/a(n) = Pi; lim_{n->infinity} a(n)*a(n-2)/a(n-1)^2 = 1 + 1/(n-1). - Gerald McGarvey, Aug 13 2004
a(n) = Sum_{k=0..n} binomial(n, k)*A000111(n-k). a(2*n) = A000795(n) + A009747(n), a(2*n+1) = A002084(n) + A003719(n). - Philippe Deléham, Aug 28 2005
a(n) = A227862(n, n * (n mod 2)). - Reinhard Zumkeller, Nov 01 2013
G.f.: E(0)*x/(1-x)/(1-2*x) + 1/(1-x), where E(k) = 1 - x^2*(k + 1)*(k + 2)/(x^2*(k + 1)*(k + 2) - 2*(x*(k + 2) - 1)*(x*(k + 3) - 1)/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jan 16 2014
a(n) ~ n! * exp(Pi/2) * 2^(n+2) / Pi^(n+1). - Vaclav Kotesovec, Jun 12 2015

A119879 Exponential Riordan array (sech(x),x).

Original entry on oeis.org

1, 0, 1, -1, 0, 1, 0, -3, 0, 1, 5, 0, -6, 0, 1, 0, 25, 0, -10, 0, 1, -61, 0, 75, 0, -15, 0, 1, 0, -427, 0, 175, 0, -21, 0, 1, 1385, 0, -1708, 0, 350, 0, -28, 0, 1, 0, 12465, 0, -5124, 0, 630, 0, -36, 0, 1, -50521, 0, 62325, 0, -12810, 0, 1050, 0, -45, 0, 1
Offset: 0

Views

Author

Paul Barry, May 26 2006

Keywords

Comments

Row sums have e.g.f. exp(x)*sech(x) (signed version of A009006). Inverse of masked Pascal triangle A119467. Transforms the sequence with e.g.f. g(x) to the sequence with e.g.f. g(x)*sech(x).
Coefficients of the Swiss-Knife polynomials for the computation of Euler, tangent and Bernoulli number (triangle read by rows). Another version in A153641. - Philippe Deléham, Oct 26 2013
Relations to Green functions and raising/creation and lowering/annihilation/destruction operators are presented in Hodges and Sukumar and in Copeland's discussion of this sequence and 2020 pdf. - Tom Copeland, Jul 24 2020

Examples

			Triangle begins:
     1;
     0,    1;
    -1,    0,     1;
     0,   -3,     0,   1;
     5,    0,    -6,   0,   1;
     0,   25,     0, -10,   0,   1;
   -61,    0,    75,   0, -15,   0,   1;
     0, -427,     0, 175,   0, -21,   0,  1;
  1385,    0, -1708,   0, 350,   0, -28,  0,  1;
		

Crossrefs

Row sums are A155585. - Johannes W. Meijer, Apr 20 2011
Rows reversed: A081658.

Programs

  • Maple
    T := (n,k) -> binomial(n,k)*2^(n-k)*euler(n-k,1/2): # Peter Luschny, Jan 25 2009
  • Mathematica
    T[n_, k_] := Binomial[n, k] 2^(n-k) EulerE[n-k, 1/2];
    Table[T[n, k], {n, 0, 10}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 20 2018, after Peter Luschny *)
  • PARI
    {T(n,k) = binomial(n,k)*2^(n-k)*(2/(n-k+1))*(subst(bernpol(n-k+1, x), x, 1/2) - 2^(n-k+1)*subst(bernpol(n-k+1, x), x, 1/4))};
    for(n=0,5, for(k=0,n, print1(T(n,k), ", "))) \\ G. C. Greubel, Feb 25 2019
  • Sage
    @CachedFunction
    def A119879_poly(n, x) :
        return 1 if n == 0  else add(A119879_poly(k, 0)*binomial(n, k)*(x^(n-k)-1+n%2) for k in range(n)[::2])
    def A119879_row(n) :
        R = PolynomialRing(ZZ, 'x')
        return R(A119879_poly(n,x)).coeffs()  # Peter Luschny, Jul 16 2012
    # Alternatively:
    
  • Sage
    # uses[riordan_array from A256893]
    riordan_array(sech(x), x, 9, exp=true) # Peter Luschny, Apr 19 2015
    

Formula

Number triangle whose k-th column has e.g.f. sech(x)*x^k/k!.
T(n,k) = C(n,k)*2^(n-k)*E_{n-k}(1/2) where C(n,k) is the binomial coefficient and E_{m}(x) are the Euler polynomials. - Peter Luschny, Jan 25 2009
The coefficients in ascending order of x^i of the polynomials p{0}(x) = 1 and p{n}(x) = Sum_{k=0..n-1; k even} binomial(n,k)*p{k}(0)*((n mod 2) - 1 + x^(n-k)). - Peter Luschny, Jul 16 2012
E.g.f.: exp(x*z)/cosh(x). - Peter Luschny, Aug 01 2012
Sum_{k=0..n} T(n,k)*x^k = A122045(n), A155585(n), A119880(n), A119881(n) for x = 0, 1, 2, 3 respectively. - Philippe Deléham, Oct 27 2013
With all offsets 0, let A_n(x;y) = (y + E.(x))^n, an Appell sequence in y where E.(x)^k = E_k(x) are the Eulerian polynomials of A123125. Then the row polynomials of A046802 (the h-polynomials of the stellahedra) are given by h_n(x) = A_n(x;1); the row polynomials of A248727 (the face polynomials of the stellahedra), by f_n(x) = A_n(1 + x;1); the Swiss-knife polynomials of this entry, A119879, by Sw_n(x) = A_n(-1;1 + x); and the row polynomials of the Worpitsky triangle (A130850), by w_n(x) = A(1 + x;0). Other specializations of A_n(x;y) give A090582 (the f-polynomials of the permutohedra, cf. also A019538) and A028246 (another version of the Worpitsky triangle). - Tom Copeland, Jan 24 2020
Triangle equals P*((I + P^2)/2)^(-1), where P denotes Pascal's triangle A007318. - Peter Bala, Mar 07 2024

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)

A230960 Boustrophedon transform of factorials, cf. A000142.

Original entry on oeis.org

1, 2, 5, 17, 73, 381, 2347, 16701, 134993, 1222873, 12279251, 135425553, 1627809401, 21183890469, 296773827547, 4453511170517, 71275570240417, 1211894559430065, 21816506949416611, 414542720924028441, 8291224789668806345, 174120672081098057341
Offset: 0

Views

Author

Reinhard Zumkeller, Nov 05 2013

Keywords

Crossrefs

Programs

  • Haskell
    a230960 n = sum $ zipWith (*) (a109449_row n) a000142_list
    
  • Mathematica
    T[n_, k_] := (n!/k!) SeriesCoefficient[(1 + Sin[x])/Cos[x], {x, 0, n - k}];
    a[n_] := Sum[T[n, k] k!, {k, 0, n}];
    Table[a[n], {n, 0, 21}] (* Jean-François Alcover, Jul 02 2019 *)
  • Python
    from itertools import count, islice, accumulate
    def A230960_gen(): # generator of terms
        blist, m = tuple(), 1
        for i in count(1):
            yield (blist := tuple(accumulate(reversed(blist),initial=m)))[-1]
            m *= i
    A230960_list = list(islice(A230960_gen(),30)) # Chai Wah Wu, Jun 11 2022

Formula

a(n) = Sum_{k=0..n} A109449(n,k)*A000142(k).
E.g.f.: (tan(x)+sec(x))/(1-x) = (1- 12*x/(Q(0)+6*x+3*x^2))/(1-x), where Q(k) = 2*(4*k+1)*(32*k^2+16*k-x^2-6) - x^4*(4*k-1)*(4*k+7)/Q(k+1) ; (continued fraction). - Sergei N. Gladkovskii, Nov 18 2013
a(n) ~ n! * (1+sin(1))/cos(1). - Vaclav Kotesovec, Jun 12 2015
a(n) = Sum_{k=0..n} (k+1) * A092580(n,k). - Alois P. Heinz, Apr 27 2023

A062272 Boustrophedon transform of (n+1) mod 2.

Original entry on oeis.org

1, 1, 2, 5, 12, 41, 152, 685, 3472, 19921, 126752, 887765, 6781632, 56126201, 500231552, 4776869245, 48656756992, 526589630881, 6034272215552, 72989204937125, 929327412759552, 12424192360405961, 174008703107274752
Offset: 0

Views

Author

Frank Ellermann, Jun 16 2001

Keywords

Crossrefs

A000734 (binomial transform), a(2n+1)= A003719(n), a(2n)= A000795(n),
Cf. A062161 (n mod 2).
Row sums of A162170 minus A000035. - Mats Granvik, Jun 27 2009
Cf. A059841.

Programs

  • Haskell
    a062272 n = sum $ zipWith (*) (a109449_row n) $ cycle [1,0]
    -- Reinhard Zumkeller, Nov 03 2013
    
  • Mathematica
    s[n_] = Mod[n+1, 2]; 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 *)
  • Python
    from itertools import accumulate, islice
    def A062272_gen(): # generator of terms
        blist, m = tuple(), 0
        while True:
            yield (blist := tuple(accumulate(reversed(blist),initial=(m := 1-m))))[-1]
    A062272_list = list(islice(A062272_gen(),40)) # Chai Wah Wu, Jun 12 2022
  • Sage
    # Generalized algorithm of L. Seidel (1877)
    def A062272_list(n) :
        R = []; A = {-1:0, 0:0}
        k = 0; e = 1
        for i in range(n) :
            Am = 1 if e == 1 else 0
            A[k + e] = 0
            e = -e
            for j in (0..i) :
                Am += A[k]
                A[k] = Am
                k += e
            R.append(A[e*i//2])
        return R
    A062272_list(10) # Peter Luschny, Jun 02 2012
    

Formula

E.g.f.: (sec(x)+tan(x))cosh(x); a(n)=(A000667(n)+A062162(n))/2. - Paul Barry, Jan 21 2005
a(n) = Sum{k, k>=0} binomial(n, 2k)*A000111(n-2k). - Philippe Deléham, Aug 28 2005
a(n) = sum(A109449(n,k) * (1 - n mod 2): k=0..n). - Reinhard Zumkeller, Nov 03 2013

A000738 Boustrophedon transform (first version) of Fibonacci numbers 0,1,1,2,3,...

Original entry on oeis.org

0, 1, 3, 8, 25, 85, 334, 1497, 7635, 43738, 278415, 1949531, 14893000, 123254221, 1098523231, 10490117340, 106851450165, 1156403632189, 13251409502982, 160286076269309, 2040825708462175, 27283829950774822, 382127363497453243, 5595206208670390323
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a000738 n = sum $ zipWith (*) (a109449_row n) a000045_list
    -- Reinhard Zumkeller, Nov 03 2013
    
  • Maple
    read(transforms);
    with(combinat):
    F:=fibonacci;
    [seq(F(n),n=0..50)];
    BOUS2(%);
  • Mathematica
    FullSimplify[CoefficientList[Series[(2/Sqrt[5]) * E^(x/2) * (E^(Sqrt[5]/2*x)/2 - E^(-Sqrt[5]/2*x)/2) * (Sin[x]+1) / Cos[x], {x, 0, 20}], x]* Range[0, 20]!] (* Vaclav Kotesovec after Alois P. Heinz, Oct 05 2013 *)
    t[n_, 0] := Fibonacci[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 *)
  • Python
    from itertools import islice, accumulate
    def A000738_gen(): # generator of terms
        blist, a, b = tuple(), 0, 1
        while True:
            yield (blist := tuple(accumulate(reversed(blist),initial=a)))[-1]
            a, b = b, a+b
    A000738_list = list(islice(A000738_gen(),30)) # Chai Wah Wu, Jun 11 2022

Formula

E.g.f.: (2/sqrt(5)) * exp(x/2) * sinh((sqrt(5)/2)*x) * (sin(x)+1) / cos(x). - Alois P. Heinz, Feb 08 2011
a(n) ~ 4*(exp(sqrt(5)*Pi/2)-1) * (2*n/Pi)^(n+1/2) * exp(Pi/4-n-sqrt(5)*Pi/4) / sqrt(5). - Vaclav Kotesovec, Oct 05 2013
a(n) = sum(A109449(n,k)*A000045(k): k=0..n). - Reinhard Zumkeller, Nov 03 2013

Extensions

Entry revised by N. J. A. Sloane, Mar 16 2011

A000747 Boustrophedon transform of primes.

Original entry on oeis.org

2, 5, 13, 35, 103, 345, 1325, 5911, 30067, 172237, 1096319, 7677155, 58648421, 485377457, 4326008691, 41310343279, 420783672791, 4553946567241, 52184383350787, 631210595896453, 8036822912123765, 107444407853010597, 1504827158220643895, 22034062627659931905
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    a000747 n = sum $ zipWith (*) (a109449_row n) a000040_list
    -- Reinhard Zumkeller, Nov 03 2013
    
  • Mathematica
    t[n_, 0] := Prime[n+1]; 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 *)
  • Python
    from itertools import islice, count, accumulate
    from sympy import prime
    def A000747_gen(): # generator of terms
        blist = tuple()
        for i in count(1):
            yield (blist := tuple(accumulate(reversed(blist),initial=prime(i))))[-1]
    A000747_list = list(islice(A000747_gen(),30)) # Chai Wah Wu, Jun 11 2022

Formula

a(n) = Sum_{k=0..n} A109449(n,k)*A000040(k+1). - Reinhard Zumkeller, Nov 03 2013
E.g.f.: (sec(x) + tan(x)) * Sum_{k>=0} prime(k+1)*x^k/k!. - Ilya Gutkovskiy, Jun 26 2018
Showing 1-10 of 50 results. Next