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

A166588 Partial sums of A097331; binomial transform of A166587.

Original entry on oeis.org

1, 2, 2, 3, 3, 5, 5, 10, 10, 24, 24, 66, 66, 198, 198, 627, 627, 2057, 2057, 6919, 6919, 23715, 23715, 82501, 82501, 290513, 290513, 1033413, 1033413, 3707853, 3707853, 13402698, 13402698, 48760368, 48760368, 178405158, 178405158, 656043858
Offset: 0

Views

Author

Paul Barry, Oct 17 2009

Keywords

Comments

Hankel transform is A131713. The Hankel transform of the sequence 1,1,2,2,... is A128017(n+3). A155587 doubled.

Programs

  • Mathematica
    CoefficientList[Series[(1+2*x-Sqrt[1-4*x^2])/(2*x*(1-x)), {x, 0, 40}], x] (* Vaclav Kotesovec, Feb 08 2014 *)

Formula

G.f.: (1+2x-sqrt(1-4x^2))/(2x(1-x))=((1+x^2*c(x^2))/(1-x)-1)/x, c(x) the g.f. of A000108.
a(n) = Sum_{k=0..n} C(n,k)*A166587(k).
Conjecture: (-n-1)*a(n) + (n+1)*a(n-1) + 4*(n-2)*a(n-2) + 4*(-n+2)*a(n-3) = 0. - R. J. Mathar, Nov 15 2012
a(n) ~ 2^(n+1/2) * (3-(-1)^n) / (3 * sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Feb 08 2014

A001405 a(n) = binomial(n, floor(n/2)).

Original entry on oeis.org

1, 1, 2, 3, 6, 10, 20, 35, 70, 126, 252, 462, 924, 1716, 3432, 6435, 12870, 24310, 48620, 92378, 184756, 352716, 705432, 1352078, 2704156, 5200300, 10400600, 20058300, 40116600, 77558760, 155117520, 300540195, 601080390, 1166803110
Offset: 0

Views

Author

Keywords

Comments

Sperner's theorem says that this is the maximal number of subsets of an n-set such that no one contains another.
When computed from index -1, [seq(binomial(n,floor(n/2)), n = -1..30)]; -> [1,1,1,2,3,6,10,20,35,70,126,...] and convolved with aerated Catalan numbers [seq(((n+1) mod 2)*binomial(n,n/2)/((n/2)+1), n = 0..30)]; -> [1,0,1,0,2,0,5,0,14,0,42,0,132,0,...] shifts left by one: [1,1,2,3,6,10,20,35,70,126,252,...] and if again convolved with aerated Catalan numbers, gives A037952 apart from the initial term. - Antti Karttunen, Jun 05 2001 [This is correct because the g.f.'s satisfy (1+x*g001405(x))*g126120(x) = g001405(x) and g001405(x)*g126120(x) = g037952(x)/x. - R. J. Mathar, Sep 23 2021]
Number of ordered trees with n+1 edges, having nonroot nodes of outdegree 0 or 2. - Emeric Deutsch, Aug 02 2002
Gives for n >= 1 the maximum absolute column sum norm of the inverse of the Vandermonde matrix (a_ij) i=0..n-1, j=0..n-1 with a_00=1 and a_ij=i^j for (i,j) != (0,0). - Torsten Muetze, Feb 06 2004
Image of Catalan numbers A000108 under the Riordan array (1/(1-2x),-x/(1-2x)) or A065109. - Paul Barry, Jan 27 2005
Number of left factors of Dyck paths, consisting of n steps. Example: a(4)=6 because we have UDUD, UDUU, UUDD, UUDU, UUUD and UUUU, where U=(1,1) and D=(1,-1). - Emeric Deutsch, Apr 23 2005
Number of dispersed Dyck paths of length n; they are defined as concatenations of Dyck paths and (1,0)-steps on the x-axis; equivalently, Motzkin paths with no (1,0)-steps at positive height. Example: a(4)=6 because we have HHHH, HHUD, HUDH, UDHH, UDUD, and UUDD, where U=(1,1), H=(1,0), and D=(1,-1). - Emeric Deutsch, Jun 04 2011
a(n) is odd iff n=2^k-1. - Jon Perry, May 05 2005
An inverse Chebyshev transform of binomial(1,n)=(1,1,0,0,0,...) where g(x)->(1/sqrt(1-4*x^2))*g(x*c(x^2)), with c(x) the g.f. of A000108. - Paul Barry, May 13 2005
In a random walk on the number line, starting at 0 and with 0 absorbing after the first step, number of ways of ending up at a positive integer after n steps. - Joshua Zucker, Jul 31 2005
Maximum number of sums of the form Sum_{i=1..n} e(i)*a(i) that are congruent to 0 mod q, where e_i=0 or 1 and gcd(a_i,q)=1, provided that q > ceiling(n/2). - Ralf Stephan, Apr 27 2003
Also the number of standard tableaux of height <= 2. - Mike Zabrocki, Mar 24 2007
Hankel transform of this sequence forms A000012 = [1,1,1,1,1,1,1,...]. - Philippe Deléham, Oct 24 2007
A001263 * [1, -2, 3, -4, 5, ...] = [1, -1, -2, 3, 6, -10, -20, 35, 70, -126, ...]. - Gary W. Adamson, Jan 02 2008
Equals right border of triangle A153585. - Gary W. Adamson, Dec 28 2008
Second binomial transform of A168491. - Philippe Deléham, Nov 27 2009
a(n) is also the number of distinct strings of length n, each of which is a prefix of a string of balanced parentheses; see example. - Lee A. Newberg, Apr 26 2010
Number of symmetric balanced strings of n pairs of parentheses; see example. - Joerg Arndt, Jul 25 2011
a(n) is the number of permutation patterns modulo 2. - Olivier Gérard, Feb 25 2011
For n >= 2, a(n-1) is the number of incongruent two-color bracelets of 2*n-1 beads, n of which are black (A007123), having a diameter of symmetry. - Vladimir Shevelev, May 03 2011
The number of permutations of n elements where p(k-2) < p(k) for all k. - Joerg Arndt, Jul 23 2011
Also size of the equivalence class of S_{n+1} containing the identity permutation under transformations of positionally adjacent elements of the form abc <--> cba where a < b < c, cf. A210668. - Tom Roby, May 15 2012
a(n) is the number of symmetric Dyck paths of length 2n. - Matt Watson, Sep 26 2012
a(n) is divisible by A000108(floor(n/2)) = abs(A129996(n-2)). - Paul Curtz, Oct 23 2012
a(n) is the number of permutations of length n avoiding both 213 and 231 in the classical sense which are breadth-first search reading words of increasing unary-binary trees. For more details, see the entry for permutations avoiding 231 at A245898. - Manda Riehl, Aug 05 2014
Number of symmetric standard Young tableaux of shape (n,n). - Ran Pan, Apr 10 2015
From Luciano Ancora, May 09 2015: (Start)
Also "stepped path" in the array formed by partial sums of the all 1's sequence (or a Pascal's triangle displayed as a square). Example:
[1], [1], 1, 1, 1, 1, 1, ... A000012
1, [2], [3], 4, 5, 6, 7, ...
1, 3, [6], [10], 15, 21, 28, ...
1, 4, 10, [20], [35], 56, 84, ...
1, 5, 15, 35, [70], [126], 210, ...
Sequences in second formula are the mixed diagonals shown in this array. (End)
a(n) = A265848(n,n). - Reinhard Zumkeller, Dec 24 2015
The constant Sum_{n >= 0} a(n)/n! is 1 + A130820. - Peter Bala, Jul 02 2016
Number of meanders (walks starting at the origin and ending at any altitude >= 0 that may touch but never go below the x-axis) with n steps from {-1,1}. - David Nguyen, Dec 20 2016
a(n) is also the number of paths of n steps (either up or down by 1) that end at the maximal value achieved along the path. - Winston Luo, Jun 01 2017
Number of binary n-tuples such that the number of 1's in the even positions is the same as the number of 1's in the odd positions. - Juan A. Olmos, Dec 21 2017
Equivalently, a(n) is the number of subsets of {1,...,n} containing as many even numbers as odd numbers. - Gus Wiseman, Mar 17 2018
a(n) is the number of Dyck paths with semilength = n+1, returns to the x-axis = floor((n+3)/2) and up movements in odd positions = floor((n+3)/2). Example: a(4)=6, U=up movement in odd position, u=up movement in even position, d=down movement, -=return to x-axis: Uududd-Ud-Ud-, Ud-Uudd-Uudd-, Uudd-Uudd-Ud-, Ud-Ud-Uududd-, Uudd-Ud-Uudd-, Ud-Uududd-Ud-. - Roger Ford, Dec 29 2017
Let C_n(R, H) denote the transition matrix from the ribbon basis to the homogeneous basis of the graded component of the algebra of noncommutative symmetric functions of order n. Letting I(2^(n-1)) denote the identity matrix of order 2^(n-1), it has been conjectured that the dimension of the kernel of C_n(R, H) - I(2^(n-1)) is always equal to a(n-1). - John M. Campbell, Mar 30 2018
The number of U-equivalence classes of Łukasiewicz paths. Łukasiewicz paths are U-equivalent iff the positions of pattern U are identical in these paths. - Sergey Kirgizov, Apr 08 2018
All binary self-dual codes of length 2n, for n > 0, must contain at least a(n) codewords of weight n. More to the point, there will always be at least one, perhaps unique, binary self-dual code of length 2n that will contain exactly a(n) codewords that have a hamming weight equal to half the length of the code (n). This code can be constructed by direct summing the unique binary self-dual code of length 2 (up to permutation equivalence) to itself n times. A permutation equivalent code can be constructed by augmenting two identity matrices of length n together. - Nathan J. Russell, Nov 25 2018
Closed under addition. - Torlach Rush, Apr 18 2019
The sequence starting (1, 2, 3, 6, ...) is the invert transform of A097331: (1, 1, 0, 1, 0, 2, 0, 5, 0, 14, 0, 42, ...). - Gary W. Adamson, Feb 22 2020
From Gary W. Adamson, Feb 24 2020: (Start)
The sequence is the culminating limit of an infinite set of sequences with convergents of 2*cos(Pi/N), N = (3, 5, 7, 9, ...).
The first few such sequences are:
N = 3: (1, 1, 1, 1, 1, 1, 1, 1, ...)
N = 5: (1, 1, 2, 3, 5, 8, 13, 21, ...) = A000045
N = 7: (1, 1, 2, 3, 6, 10, 19, 33, ...) = A028495, a(n)/a(n-1) tends to 1.801937...
N = 9 (1, 1, 2, 3, 6, 10, 20, 35, ...) = A061551, a(n)/a(n_1) tends to 1.879385...
...
In the limit one gets the current sequence with ratio 2. (End)
a(n) is also the number of monotone lattice paths from (0,0) to (floor(n/2),ceiling(n/2)). These are the number of Grand Dyck paths when n is even. - Nachum Dershowitz, Aug 12 2020
The maximum number of preimages that a permutation of length n+1 can have under the consecutive-132-avoiding stack-sorting map. - Colin Defant, Aug 28 2020
Counts faro permutations of length n. Faro permutations are permutations avoiding the three consecutive patterns 231, 321 and 312. They are obtained by a perfect faro shuffle of two nondecreasing words of lengths differing by at most one. - Sergey Kirgizov, Jan 12 2021
Per "Sperner's Theorem", the largest possible familes of finite sets none of which contain any other sets in the family. - Renzo Benedetti, May 26 2021
a(n-1) are the incomplete, primitive Dyck paths of n steps without a first return: paths of U and D steps starting at the origin, never touching the horizontal axis later on, and ending above the horizontal axis. n=1: {U}, n=2: {UU}, n=3: {UUU, UUD}, n=4: {UUUU, UUUD, UUDU}, n=5: {UUUUU, UUUUD, UUUDD, UUDUU, UUUDU, UUDUD}. For comparison: A037952 counts incomplete Dyck paths with n steps with any number of intermediate returns to the horizontal axis, ending above the horizontal axis. - R. J. Mathar, Sep 24 2021
a(n) is the number of noncrossing partitions of [n] whose nontrivial blocks are of type {a,b}, with a <= n/2, b > n/2. - Francesca Aicardi, May 29 2022
Maximal coefficient of (1+x)^n. - Vaclav Kotesovec, Dec 30 2022
Sums of lower-left-to-upper-right diagonals of the Catalan Triangle A001263. - Howard A. Landman, Sep 16 2024

Examples

			For n = 4, the a(4) = 6 distinct strings of length 4, each of which is a prefix of a string of balanced parentheses, are ((((, (((), (()(, ()((, ()(), and (()). - _Lee A. Newberg_, Apr 26 2010
There are a(5)=10 symmetric balanced strings of 5 pairs of parentheses:
[ 1] ((((()))))
[ 2] (((()())))
[ 3] ((()()()))
[ 4] ((())(()))
[ 5] (()()()())
[ 6] (()(())())
[ 7] (())()(())
[ 8] ()()()()()
[ 9] ()((()))()
[10] ()(()())() - _Joerg Arndt_, Jul 25 2011
G.f. = 1 + x + 2*x^2 + 3*x^3 + 6*x^4 + 10*x^5 + 20*x^6 + 35*x^7 + 70*x^8 + ...
The a(4)=6 binary 4-tuples such that the number of 1's in the even positions is the same as the number of 1's in the odd positions are 0000, 1100, 1001, 0110, 0011, 1111. - _Juan A. Olmos_, Dec 21 2017
		

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. 828.
  • M. Aigner and G. M. Ziegler, Proofs from The Book, Springer-Verlag, Berlin, 1999; see p. 135.
  • K. Engel, Sperner Theory, Camb. Univ. Press, 1997; Theorem 1.1.1.
  • P. Frankl, Extremal sets systems, Chap. 24 of R. L. Graham et al., eds, Handbook of Combinatorics, North-Holland.
  • J. C. P. Miller, editor, Table of Binomial Coefficients. Royal Society Mathematical Tables, Vol. 3, Cambridge Univ. Press, 1954.
  • 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. 2, 1999; see Problem 7.16(b), p. 452.

Crossrefs

Row sums of Catalan triangle A053121 and of symmetric Dyck paths A088855.
Enumerates the structures encoded by A061854 and A061855.
First differences are in A037952.
Apparently a(n) = lim_{k->infinity} A094718(k, n).
Partial sums are in A036256. Column k=2 of A182172. Column k=1 of A335570.
Bisections: A000984 (even part), A001700 (odd part).
Cf. A097331.
Cf. A107373, A340567, A340568, A340569 (popularity of certain patterns in faro permutations).

Programs

  • GAP
    List([0..40],n->Binomial(n,Int(n/2))); # Muniru A Asiru, Apr 08 2018
    
  • Haskell
    a001405 n = a007318_row n !! (n `div` 2) -- Reinhard Zumkeller, Nov 09 2011
    
  • Magma
    [Binomial(n, Floor(n/2)): n in [0..40]]; // Vincenzo Librandi, Nov 16 2014
    
  • Maple
    A001405 := n->binomial(n, floor(n/2)): seq(A001405(n), n=0..33);
  • Mathematica
    Table[Binomial[n, Floor[n/2]], {n, 0, 40}] (* Stefan Steinerberger, Apr 08 2006 *)
    Table[DifferenceRoot[Function[{a,n},{-4 n a[n]-2 a[1+n]+(2+n) a[2+n] == 0,a[1] == 1,a[2] == 1}]][n], {n, 30}] (* Luciano Ancora, Jul 08 2015 *)
    Array[Binomial[#,Floor[#/2]]&,40,0] (* Harvey P. Dale, Mar 05 2018 *)
  • Maxima
    A001405(n):=binomial(n,floor(n/2))$
    makelist(A001405(n),n,0,30); /* Martin Ettl, Nov 01 2012 */
    
  • PARI
    a(n) = binomial(n, n\2);
    
  • PARI
    first(n) = x='x+O('x^n); Vec((-1+2*x+sqrt(1-4*x^2))/(2*x-4*x^2)) \\ Iain Fox, Dec 20 2017 (edited by Iain Fox, May 07 2018)
    
  • Python
    from math import comb
    def A001405(n): return comb(n,n//2) # Chai Wah Wu, Jun 07 2022

Formula

a(n) = max_{k=0..n} binomial(n, k).
a(2*n) = A000984(n), a(2*n+1) = A001700(n).
By symmetry, a(n) = binomial(n, ceiling(n/2)). - Labos Elemer, Mar 20 2003
P-recursive with recurrence: a(0) = 1, a(1) = 1, and for n >= 2, (n+1)*a(n) = 2*a(n-1) + 4*(n-1)*a(n-2). - Peter Bala, Feb 28 2011
G.f.: (1+x*c(x^2))/sqrt(1-4*x^2) = 1/(1 - x - x^2*c(x^2)); where c(x) = g.f. for Catalan numbers A000108.
G.f.: (-1 + 2*x + sqrt(1-4*x^2))/(2*x - 4*x^2). - Lee A. Newberg, Apr 26 2010
G.f.: 1/(1 - x - x^2/(1 - x^2/(1 - x^2/(1 - x^2/(1 - ... (continued fraction). - Paul Barry, Aug 12 2009
a(0) = 1; a(2*m+2) = 2*a(2*m+1); a(2*m+1) = Sum_{k = 0..2*m} (-1)^k*a(k)*a(2*m-k). - Len Smiley, Dec 09 2001
G.f.: (sqrt((1+2*x)/(1-2*x)) - 1)/(2*x). - Vladeta Jovovic, Apr 28 2003
The o.g.f. A(x) satisfies A(x) + x*A^2(x) = 1/(1-2*x). - Peter Bala, Feb 28 2011
E.g.f.: BesselI(0, 2*x) + BesselI(1, 2*x). - Vladeta Jovovic, Apr 28 2003
a(0) = 1; a(2*m+2) = 2*a(2*m+1); a(2*m+1) = 2*a(2*m) - c(m), where c(m)=A000108(m) are the Catalan numbers. - Christopher Hanusa (chanusa(AT)washington.edu), Nov 25 2003
a(n) = Sum_{k=0..n} (-1)^k*2^(n-k)*binomial(n, k)*A000108(k). - Paul Barry, Jan 27 2005
a(n) = Sum_{k=0..floor(n/2)} binomial(n, k)*binomial(1, n-2*k). - Paul Barry, May 13 2005
From Paul Barry, Nov 02 2004: (Start)
a(n) = Sum_{k=0..floor((n+1)/2)} (binomial(n+1, k)*(cos((n-2*k+1)*Pi/2) + sin((n-2*k+1)*Pi/2))).
a(n) = Sum_{k=0..n+1}, (binomial(n+1, (n-k+1)/2)*(1-(-1)^(n-k))*(cos(k*Pi/2) + sin(k*Pi))/2). (End)
a(n) = Sum_{k=floor(n/2)..n} (binomial(n,n-k) - binomial(n,n-k-1)). - Paul Barry, Sep 06 2007
Inverse binomial transform of A005773 starting (1, 2, 5, 13, 35, 96, ...) and double inverse binomial transform of A001700. Row sums of triangle A132815. - Gary W. Adamson, Aug 31 2007
a(n) = Sum_{k=0..n} A120730(n,k). - Philippe Deléham, Oct 16 2008
a(n) = Sum_{k = 0..floor(n/2)} (binomial(n,k) - binomial(n,k-1)). - Nishant Doshi (doshinikki2004(AT)gmail.com), Apr 06 2009
Sum_{n>=0} a(n)/10^(n+1) = 0.1123724... = (sqrt(3)-sqrt(2))/(2*sqrt(2)); Sum_{n>=0} a(n)/100^(n+1) = 0.0101020306102035... = (sqrt(51)-sqrt(49))/(2*sqrt(49)). - Mark Dols, Jul 15 2010
Conjectured: a(n) = 2^n*2F1(1/2,-n;2;2), useful for number of paths in 1-d for which the coordinate is never negative. - Benjamin Phillabaum, Feb 20 2011
a(2*m+1) = (2*m+1)*a(2*m)/(m+1), e.g., a(7) = (7/4)*a(6) = (7/4)*20 = 35. - Jon Perry, Jan 20 2011
From Peter Bala, Feb 28 2011: (Start)
Let F(x) be the logarithmic derivative of the o.g.f. A(x). Then 1+x*F(x) is the o.g.f. for A027306.
Let G(x) be the logarithmic derivative of 1+x*A(x). Then x*G(x) is the o.g.f. for A058622. (End)
Let M = an infinite tridiagonal matrix with 1's in the super and subdiagonals and [1,0,0,0,...] in the main diagonal; and V = the vector [1,0,0,0,...]. a(n) = M^n*V, leftmost term. - Gary W. Adamson, Jun 13 2011
Let M = an infinite tridiagonal matrix with 1's in the super and subdiagonals and [1,0,0,0,...] in the main diagonal. a(n) = M^n_{1,1}. - Corrected by Gary W. Adamson, Jan 30 2012
a(n) = A007318(n, floor(n/2)). - Reinhard Zumkeller, Nov 09 2011
a(n+1) = Sum_{k=0..n} a(n-k)*A097331(k) = a(n) + Sum_{k=0..(n-1)/2} A000108(k)*a(n-2*k-1). - Philippe Deléham, Nov 27 2011
a(n) = A214282(n) - A214283(n), for n > 0. - Reinhard Zumkeller, Jul 14 2012
a(n) = Sum_{k=0..n} A168511(n,k)*(-1)^(n-k). - Philippe Deléham, Mar 19 2013
a(n+2*p-2) = Sum_{k=0..floor(n/2)} A009766(n-k+p-1, k+p-1) + binomial(n+2*p-2, p-2), for p >= 1. - Johannes W. Meijer, Aug 02 2013
O.g.f.: (1-x*c(x^2))/(1-2*x), with the o.g.f. c(x) of Catalan numbers A000108. See the rewritten formula given by Lee A. Newberg above. This is the o.g.f. for the row sums the Riordan triangle A053121. - Wolfdieter Lang, Sep 22 2013
a(n) ~ 2^n / sqrt(Pi * n/2). - Charles R Greathouse IV, Oct 23 2015
a(n) = 2^n*hypergeom([1/2,-n], [2], 2). - Vladimir Reshetnikov, Nov 02 2015
a(2*k) = Sum_{i=0..k} binomial(k, i)*binomial(k, i), a(2*k+1) = Sum_{i=0..k} binomial(k+1, i)*binomial(k, i). - Juan A. Olmos, Dec 21 2017
a(0) = 1, a(n) = 2 * a(n-1) for even n, a(n) = (2*n/(n+1)) * a(n-1) for odd n. - James East, Sep 25 2019
a(n) = A037952(n) + A000108(n/2) where A(.)=0 for non-integer argument. - R. J. Mathar, Sep 23 2021
From Amiram Eldar, Mar 10 2022: (Start)
Sum_{n>=0} 1/a(n) = 2*Pi/(3*sqrt(3)) + 2.
Sum_{n>=0} (-1)^n/a(n) = 2/3 - 2*Pi/(9*sqrt(3)). (End)
For k>2, Sum_{n>=0} a(n)/k^n = (sqrt((k+2)/(k-2)) - 1)*k/2. - Vaclav Kotesovec, May 13 2022
From Peter Bala, Mar 24 2023: (Start)
a(n) = Sum_{k = 0..n+1} (-1)^(k+binomial(n+2,2)) * k/(n+1) * binomial(n+1,k)^2.
(n + 1)*(2*n - 1)*a(n) = (-1)^(n+1)*2*a(n-1) + 4*(n - 1)*(2*n + 1)*a(n-2) with a(0) = a(1) = 1. (End)
a(n) = Integral_{x=-2..2} x^n*W(x)*dx, n>=0, where W(x) = sqrt((2+x)/(2-x))/(2*Pi) is a positive function on x=(-2,2) and is singular at x = 2. Therefore a(n) is a positive definite sequence. - Karol A. Penson, May 12 2025

A069770 Signature permutation of the first non-identity, nonrecursive Catalan automorphism in table A089840: swap the top branches of a binary tree. An involution of nonnegative integers.

Original entry on oeis.org

0, 1, 3, 2, 7, 8, 6, 4, 5, 17, 18, 20, 21, 22, 16, 19, 14, 9, 10, 15, 11, 12, 13, 45, 46, 48, 49, 50, 54, 55, 57, 58, 59, 61, 62, 63, 64, 44, 47, 53, 56, 60, 42, 51, 37, 23, 24, 38, 25, 26, 27, 43, 52, 39, 28, 29, 40, 30, 31, 32, 41, 33, 34, 35, 36, 129, 130, 132, 133, 134
Offset: 0

Views

Author

Antti Karttunen, Apr 16 2002

Keywords

Comments

This is the simplest possible Catalan automorphism after the identity bijection (A001477). It effects the following transformation on the unlabeled rooted plane binary trees (letters A and B refer to arbitrary subtrees located on those vectices):
A B B A
\ / --> \ /
x x
(a . b) -----> (b . a)
Applying this permutation recursively to the right hand side branch of the binary trees produces permutations A069767 and A069768 (that occur at the same index 1 in tables A122203 and A122204), and applying this recursively to the both branches of binary trees (as in pre- or postorder traversal) produces A057163 (which occurs at the same index 1 in tables A122201 and A122202) that reflects the whole binary tree.
For this permutation, A127302(a(n)) = A127302(n) for all n, [or equally, A153835(a(n)) = A153835(n)], and likewise for all such recursive derivations as mentioned above.

Examples

			To obtain the signature permutation, we apply these transformations to the binary trees as encoded and ordered by A014486 and for each n, a(n) will be the position of the tree to which the n-th tree is transformed to, as follows:
.
                   one tree of one internal
  empty tree         (non-leaf) node
      x                      \/
n=    0                      1
a(n)= 0                      1               (both are always fixed)
.
the next 7 trees, with 2-3 internal nodes, in range [A014137(1), A014137(2+1)-1] = [2,8] are:
.
                          \/     \/                 \/     \/
       \/     \/         \/       \/     \/ \/     \/       \/
      \/       \/       \/       \/       \_/       \/       \/
n=     2        3        4        5        6        7        8
.
and the new shapes after swapping their left and right hand subtrees are:
.
                        \/     \/                     \/     \/
     \/         \/     \/       \/       \/ \/       \/       \/
      \/       \/       \/       \/       \_/       \/       \/
a(n)=  3        2        7        8        6        4        5
thus we obtain the first nine terms of this sequence: 0, 1, 3, 2, 7, 8, 6, 4, 5.
		

Crossrefs

Row 1 of A089840.
The number of cycles and the number of fixed points in each subrange limited by terms of A014137 are given by A007595 and A097331.
Other related sequences: A014486, A057163, A069767, A069768, A089864, A123492, A154125, A154126.
Cf. also A127302, A153835.

Formula

Extensions

Entry revised by Antti Karttunen, Oct 11 2006 and Mar 30 2024

A126120 Catalan numbers (A000108) interpolated with 0's.

Original entry on oeis.org

1, 0, 1, 0, 2, 0, 5, 0, 14, 0, 42, 0, 132, 0, 429, 0, 1430, 0, 4862, 0, 16796, 0, 58786, 0, 208012, 0, 742900, 0, 2674440, 0, 9694845, 0, 35357670, 0, 129644790, 0, 477638700, 0, 1767263190, 0, 6564120420, 0, 24466267020, 0, 91482563640, 0, 343059613650, 0
Offset: 0

Views

Author

Philippe Deléham, Mar 06 2007

Keywords

Comments

Inverse binomial transform of A001006.
The Hankel transform of this sequence gives A000012 = [1,1,1,1,1,...].
Counts returning walks (excursions) of length n on a 1-d integer lattice with step set {+1,-1} which stay in the chamber x >= 0. - Andrew V. Sutherland, Feb 29 2008
Moment sequence of the trace of a random matrix in G=USp(2)=SU(2). If X=tr(A) is a random variable (A distributed according to the Haar measure on G) then a(n) = E[X^n]. - Andrew V. Sutherland, Feb 29 2008
Essentially the same as A097331. - R. J. Mathar, Jun 15 2008
Number of distinct proper binary trees with n nodes. - Chris R. Sims (chris.r.sims(AT)gmail.com), Jun 30 2010
-a(n-1), with a(-1):=0, n>=0, is the Z-sequence for the Riordan array A049310 (Chebyshev S). For the definition see that triangle. - Wolfdieter Lang, Nov 04 2011
See A180874 (also A238390 and A097610) and A263916 for relations to the general Bell A036040, cycle index A036039, and cumulant expansion polynomials A127671 through the Faber polynomials. - Tom Copeland, Jan 26 2016
A signed version is generated by evaluating polynomials in A126216 that are essentially the face polynomials of the associahedra. This entry's sequence is related to an inversion relation on p. 34 of Mizera, related to Feynman diagrams. - Tom Copeland, Dec 09 2019

Examples

			G.f. = 1 + x^2 + 2*x^4 + 5*x^6 + 14*x^8 + 42*x^10 + 132*x^12 + 429*x^14 + ...
From _Gus Wiseman_, Nov 14 2022: (Start)
The a(0) = 1 through a(8) = 14 ordered binary rooted trees with n + 1 nodes (ranked by A358375):
  o  .  (oo)  .  ((oo)o)  .  (((oo)o)o)  .  ((((oo)o)o)o)
                 (o(oo))     ((o(oo))o)     (((o(oo))o)o)
                             ((oo)(oo))     (((oo)(oo))o)
                             (o((oo)o))     (((oo)o)(oo))
                             (o(o(oo)))     ((o((oo)o))o)
                                            ((o(o(oo)))o)
                                            ((o(oo))(oo))
                                            ((oo)((oo)o))
                                            ((oo)(o(oo)))
                                            (o(((oo)o)o))
                                            (o((o(oo))o))
                                            (o((oo)(oo)))
                                            (o(o((oo)o)))
                                            (o(o(o(oo))))
(End)
		

References

  • Jerome Spanier and Keith B. Oldham, "Atlas of Functions", Ch. 49, Hemisphere Publishing Corp., 1987.

Crossrefs

Cf. A126216.
The unordered version is A001190, ranked by A111299.
These trees (ordered binary rooted) are ranked by A358375.

Programs

  • Magma
    &cat [[Catalan(n), 0]: n in [0..30]]; // Vincenzo Librandi, Jul 28 2016
    
  • Maple
    with(combstruct): grammar := { BB = Sequence(Prod(a,BB,b)), a = Atom, b = Atom }: seq(count([BB,grammar], size=n),n=0..47); # Zerinvary Lajos, Apr 25 2007
    BB := {E=Prod(Z,Z), S=Union(Epsilon,Prod(S,S,E))}: ZL:=[S,BB,unlabeled]: seq(count(ZL, size=n), n=0..45); # Zerinvary Lajos, Apr 22 2007
    BB := [T,{T=Prod(Z,Z,Z,F,F), F=Sequence(B), B=Prod(F,Z,Z)}, unlabeled]: seq(count(BB, size=n+1), n=0..45); # valid for n> 0. # Zerinvary Lajos, Apr 22 2007
    seq(n!*coeff(series(hypergeom([],[2],x^2),x,n+2),x,n),n=0..45); # Peter Luschny, Jan 31 2015
    # Using function CompInv from A357588.
    CompInv(48, n -> ifelse(irem(n, 2) = 0, 0, (-1)^iquo(n-1, 2))); # Peter Luschny, Oct 07 2022
  • Mathematica
    a[n_?EvenQ] := CatalanNumber[n/2]; a[n_] = 0; Table[a[n], {n, 0, 45}] (* Jean-François Alcover, Sep 10 2012 *)
    a[ n_] := If[ n < 0, 0, n! SeriesCoefficient[ BesselI[ 1, 2 x] / x, {x, 0, n}]]; (* Michael Somos, Mar 19 2014 *)
    bot[n_]:=If[n==1,{{}},Join@@Table[Tuples[bot/@c],{c,Table[{k,n-k-1},{k,n-1}]}]];
    Table[Length[bot[n]],{n,10}] (* Gus Wiseman, Nov 14 2022 *)
    Riffle[CatalanNumber[Range[0,50]],0,{2,-1,2}] (* Harvey P. Dale, May 28 2024 *)
  • Python
    from math import comb
    def A126120(n): return 0 if n&1 else comb(n,m:=n>>1)//(m+1) # Chai Wah Wu, Apr 22 2024
  • Sage
    def A126120_list(n) :
        D = [0]*(n+2); D[1] = 1
        b = True; h = 2; R = []
        for i in range(2*n-1) :
            if b :
                for k in range(h,0,-1) : D[k] -= D[k-1]
                h += 1; R.append(abs(D[1]))
            else :
                for k in range(1,h, 1) : D[k] += D[k+1]
            b = not b
        return R
    A126120_list(46) # Peter Luschny, Jun 03 2012
    

Formula

a(2*n) = A000108(n), a(2*n+1) = 0.
a(n) = A053121(n,0).
(1/Pi) Integral_{0 .. Pi} (2*cos(x))^n *2*sin^2(x) dx. - Andrew V. Sutherland, Feb 29 2008
G.f.: (1 - sqrt(1 - 4*x^2)) / (2*x^2) = 1/(1-x^2/(1-x^2/(1-x^2/(1-x^2/(1-... (continued fraction). - Philippe Deléham, Nov 24 2009
G.f. A(x) satisfies A(x) = 1 + x^2*A(x)^2. - Vladimir Kruchinin, Feb 18 2011
E.g.f.: I_1(2x)/x Where I_n(x) is the modified Bessel function. - Benjamin Phillabaum, Mar 07 2011
Apart from the first term the e.g.f. is given by x*HyperGeom([1/2],[3/2,2], x^2). - Benjamin Phillabaum, Mar 07 2011
a(n) = Integral_{x=-2..2} x^n*sqrt((2-x)*(2+x))/(2*Pi) dx. - Peter Luschny, Sep 11 2011
E.g.f.: E(0)/(1-x) where E(k) = 1-x/(1-x/(x-(k+1)*(k+2)/E(k+1))); (continued fraction). - Sergei N. Gladkovskii, Apr 05 2013
G.f.: 3/2- sqrt(1-4*x^2)/2 = 1/x^2 + R(0)/x^2, where R(k) = 2*k-1 - x^2*(2*k-1)*(2*k+1)/R(k+1); (continued fraction). - Sergei N. Gladkovskii, Oct 28 2013 (warning: this is not the g.f. of this sequence, R. J. Mathar, Sep 23 2021)
G.f.: 1/Q(0), where Q(k) = 2*k+1 + x^2*(1-4*(k+1)^2)/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Jan 09 2014
a(n) = n!*[x^n]hypergeom([],[2],x^2). - Peter Luschny, Jan 31 2015
a(n) = 2^n*hypergeom([3/2,-n],[3],2). - Peter Luschny, Feb 03 2015
a(n) = ((-1)^n+1)*2^(2*floor(n/2)-1)*Gamma(floor(n/2)+1/2)/(sqrt(Pi)* Gamma(floor(n/2)+2)). - Ilya Gutkovskiy, Jul 23 2016
D-finite with recurrence (n+2)*a(n) +4*(-n+1)*a(n-2)=0. - R. J. Mathar, Mar 21 2021
From Peter Bala, Feb 03 2024: (Start)
a(n) = 2^n * Sum_{k = 0..n} (-2)^(-k)*binomial(n, k)*Catalan(k+1).
G.f.: 1/(1 + 2*x) * c(x/(1 + 2*x))^2 = 1/(1 - 2*x) * c(-x/(1 - 2*x))^2 = c(x^2), where c(x) = (1 - sqrt(1 - 4*x))/(2*x) is the g.f. of the Catalan numbers A000108. (End)

Extensions

An erroneous comment removed by Tom Copeland, Jul 23 2016

A087960 a(n) = (-1)^binomial(n+1,2).

Original entry on oeis.org

1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1, -1, -1, 1, 1
Offset: 0

Views

Author

W. Edwin Clark, Sep 17 2003

Keywords

Comments

Period 4: repeat [1, -1, -1, 1]. - Joerg Arndt, Feb 14 2016
Also equal to the sign of product(j-i, 1<=j
Hankel transform of A097331, A097332. [Paul Barry, Aug 10 2009]
The Kn22 sums, see A180662, of triangle A108299 equal the terms of this sequence. [Johannes W. Meijer, Aug 14 2011]

Examples

			a(1) = -1 since (-1)^binomial(2,2) = (-1)^1 = -1.
G.f. = 1 - x - x^2 + x^3 + x^4 - x^5 - x^6 + x^7 + x^8 - x^9 - x^10 + ...
		

References

  • I. S. Gradstein and I. M. Ryshik, Tables of series, products, and integrals, Volume 1, Verlag Harri Deutsch, 1981.

Programs

  • Haskell
    a087960 n = (-1) ^ (n * (n + 1) `div` 2)
    a087960_list = cycle [1,-1,-1,1]  -- Reinhard Zumkeller, Nov 15 2015
    
  • Magma
    [(-1)^Binomial(n+1,2) : n in [0..100]]; // Wesley Ivan Hurt, Jul 07 2016
    
  • Maple
    A087960:=n->(-1)^binomial(n+1,2): seq(A087960(n), n=0..100); # Wesley Ivan Hurt, Jul 07 2016
  • Mathematica
    (-1)^Binomial[Range[0,110],2] (* or *) LinearRecurrence[{0,-1},{1,1},110] (* Harvey P. Dale, Jul 07 2014 *)
    a[ n_] := (-1)^(n (n + 1) / 2); (* Michael Somos, Jul 20 2015 *)
    a[ n_] := (-1)^Quotient[ n + 1, 2]; (* Michael Somos, Jul 20 2015 *)
  • PARI
    {a(n) = (-1)^((n + 1)\2)}; /* Michael Somos, Jul 20 2015 */
    
  • Python
    def A087960(n): return -1 if n+1&2 else 1 # Chai Wah Wu, Jan 31 2023

Formula

a(n) = (-1)^A000217(n).
a(n) = (-1)^floor((n+1)/2). - Benoit Cloitre and Ray Chandler, Sep 19 2003
G.f.: (1-x)/(1+x^2). - Paul Barry, Aug 10 2009
a(n) = I^(n*(n+1)). - Bruno Berselli, Oct 17 2011
a(n) = Product_{k=1..n} 2*cos(2*k*Pi/(2*n+1)) for n>=0 (for n=0 the empty product is put to 1). See the Gradstein-Ryshik reference, p. 63, 1.396 2. with x = sqrt(-1). - Wolfdieter Lang, Oct 22 2013
a(n) + a(n-2) = 0 for n>1, a(n) = a(n-4) for n>3. - Wesley Ivan Hurt, Jul 07 2016
E.g.f.: cos(x) - sin(x). - Ilya Gutkovskiy, Jul 07 2016
a(n) = Sum_{s=0..n} (-1)^(n-s)*A111125(n, s)*2^s (row polynomials of signed A111125 evaluated at 2). - Wolfdieter Lang, May 02 2021

Extensions

More terms from Benoit Cloitre and Ray Chandler, Sep 19 2003
Offset and Vandermonde formula corrected by R. J. Mathar, Sep 25 2009

A105523 Expansion of 1-x*c(-x^2) where c(x) is the g.f. of A000108.

Original entry on oeis.org

1, -1, 0, 1, 0, -2, 0, 5, 0, -14, 0, 42, 0, -132, 0, 429, 0, -1430, 0, 4862, 0, -16796, 0, 58786, 0, -208012, 0, 742900, 0, -2674440, 0, 9694845, 0, -35357670, 0, 129644790, 0, -477638700, 0, 1767263190, 0
Offset: 0

Author

Paul Barry, Apr 11 2005

Keywords

Comments

Row sums of A105522. Row sums of inverse of A105438.
First column of number triangle A106180.

Examples

			G.f. = 1 - x + x^3 - 2*x^5 + 5*x^7 - 14*x^9 + 42*x^11 - 132*x^13 + 429*x^15 + ...
		

Programs

  • Magma
    m:=25; R:=PowerSeriesRing(Rationals(), m); Coefficients(R!((1 + 2*x - Sqrt(1+4*x^2))/(2*x))); // G. C. Greubel, Sep 16 2018
  • Maple
    A105523_list := proc(n) local j, a, w; a := array(0..n); a[0] := 1;
    for w from 1 to n do a[w]:=-a[w-1]+(-1)^w*add(a[j]*a[w-j-1],j=1..w-1) od; convert(a,list)end: A105523_list(40); # Peter Luschny, May 19 2011
  • Mathematica
    a[n_?EvenQ] := 0; a[n_?OddQ] := 4^n*Gamma[n/2] / (Gamma[-n/2]*(n+1)!); a[0] = 1; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Nov 14 2011, after Vladimir Kruchinin *)
    CoefficientList[Series[(1 + 2 x - Sqrt[1 + 4 x^2])/(2 x), {x, 0, 50}], x] (* Vincenzo Librandi, Nov 01 2014 *)
    a[ n_] := SeriesCoefficient[ (1 + 2 x - Sqrt[ 1 + 4 x^2]) / (2 x), {x, 0, n}]; (* Michael Somos, Jun 17 2015 *)
    a[ n_] := If[ n < 1, Boole[n == 0], a[n] = -2 a[n - 1] + Sum[ a[j] a[n - j - 1], {j, 0, n - 1}]]; (* Michael Somos, Jun 17 2015 *)
  • PARI
    {a(n) = local(A); if( n<0, 0, n++; A = vector(n); A[1] = 1; for( k=2, n, A[k] = -2 * A[k-1] + sum( j=1, k-1, A[j] * A[k-j])); A[n])}; /* Michael Somos, Jul 24 2011 */
    
  • Sage
    def A105523(n):
        if is_even(n): return 0 if n>0 else 1
        return -(sqrt(pi)*2^(n-1))/(gamma(1-n/2)*gamma((n+3)/2))
    [A105523(n) for n in (0..29)] # Peter Luschny, Oct 31 2014
    

Formula

G.f.: (1 + 2*x - sqrt(1+4*x^2))/(2*x).
a(n) = 0^n + sin(Pi*(n-2)/2)(C((n-1)/2)(1-(-1)^n)/2).
G.f.: 1/(1+x/(1-x/(1+x/(1-x/(1+x/(1-x.... (continued fraction). - Paul Barry, Jan 15 2009
a(n) = Sum{k = 0..n} A090181(n,k)*(-1)^k. - Philippe Deléham, Feb 02 2009
a(n) = (1/n)*sum_{i = 0..n-1} (-2)^i*binomial(n, i)*binomial(2*n-i-2, n-1). - Vladimir Kruchinin, Dec 26 2010
With offset 1, a(n) = -2 * a(n-1) + Sum_{k=1..n-1} a(k) * a(n-k), for n>1. - Michael Somos, Jul 25 2011
D-finite with recurrence: (n+3)*a(n+2) = -4*n*a(n), a(0)=1, a(1)=-1. - Fung Lam, Mar 18 2014
For nonzero terms, a(n) ~ (-1)^((n+1)/2)/sqrt(2*Pi)*2^(n+1)/(n+1)^(3/2). - Fung Lam, Mar 17 2014
a(n) = -(sqrt(Pi)*2^(n-1))/(Gamma(1-n/2)*Gamma((n+3)/2)) for n odd. - Peter Luschny, Oct 31 2014
From Peter Bala, Apr 20 2024: (Start)
a(n) = Sum_{k = 0..n} (-2)^(n-k)*binomial(n + k, 2*k)*Catalan(k), where Catalan(k) = A000108(k).
a(n) = (-2)^n * hypergeom([-n, n+1], [2], 1/2).
O.g.f.: A(x) = 1/x * series reversion of x*(1 - x)/(1 - 2*x). Cf. A152681. (End)

Extensions

Typo in definition corrected by Robert Israel, Oct 31 2014

A227310 G.f.: 1/G(0) where G(k) = 1 + (-q)^(k+1) / (1 - (-q)^(k+1)/G(k+1) ).

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 2, 1, 1, 3, 2, 3, 4, 4, 6, 7, 8, 11, 13, 16, 20, 24, 31, 37, 46, 58, 70, 88, 108, 133, 167, 204, 252, 315, 386, 479, 594, 731, 909, 1122, 1386, 1720, 2124, 2628, 3254, 4022, 4980, 6160, 7618, 9432, 11665, 14433, 17860, 22093, 27341, 33824, 41847, 51785, 64065, 79267
Offset: 0

Author

Joerg Arndt, Jul 06 2013

Keywords

Comments

Number of rough sandpiles: 1-dimensional sandpiles (see A186085) with n grains without flat steps (no two successive parts of the corresponding composition equal), see example. - Joerg Arndt, Mar 08 2014
The sequence of such sandpiles by base length starts (n>=0) 1, 1, 0, 1, 0, 2, 0, 5, 0, 14, 0, 42, 0, ... (A097331, essentially A000108 with interlaced zeros). This is a consequence of the obvious connection to Dyck paths, see example. - Joerg Arndt, Mar 09 2014
a(n>=1) are the Dyck paths with area n between the x-axis and the path which return to the x-axis only once (at their end), whereas A143951 includes paths with intercalated touches of the x-axis. - R. J. Mathar, Aug 22 2018

Examples

			From _Joerg Arndt_, Mar 08 2014: (Start)
The a(21) = 7 rough sandpiles are:
:
:   1:      [ 1 2 1 2 1 2 1 2 1 2 3 2 1 ]  (composition)
:
:           o
:  o o o o ooo
: ooooooooooooo  (rendering of sandpile)
:
:
:   2:      [ 1 2 1 2 1 2 1 2 3 2 1 2 1 ]
:
:         o
:  o o o ooo o
: ooooooooooooo
:
:
:   3:      [ 1 2 1 2 1 2 3 2 1 2 1 2 1 ]
:
:       o
:  o o ooo o o
: ooooooooooooo
:
:
:   4:      [ 1 2 1 2 3 2 1 2 1 2 1 2 1 ]
:
:     o
:  o ooo o o o
: ooooooooooooo
:
:
:   5:      [ 1 2 3 2 1 2 1 2 1 2 1 2 1 ]
:
:   o
:  ooo o o o o
: ooooooooooooo
:
:
:   6:      [ 1 2 3 2 3 4 3 2 1 ]
:
:      o
:   o ooo
:  ooooooo
: ooooooooo
:
:
:   7:      [ 1 2 3 4 3 2 3 2 1 ]
:
:    o
:   ooo o
:  ooooooo
: ooooooooo
(End)
From _Joerg Arndt_, Mar 09 2014: (Start)
The A097331(9) = 14 such sandpiles with base length 9 are:
01:  [ 1 2 1 2 1 2 1 2 1 ]
02:  [ 1 2 1 2 1 2 3 2 1 ]
03:  [ 1 2 1 2 3 2 3 2 1 ]
04:  [ 1 2 1 2 3 2 1 2 1 ]
05:  [ 1 2 1 2 3 4 3 2 1 ]
06:  [ 1 2 3 2 1 2 3 2 1 ]
07:  [ 1 2 3 2 1 2 1 2 1 ]
08:  [ 1 2 3 2 3 2 1 2 1 ]
09:  [ 1 2 3 2 3 2 3 2 1 ]
10:  [ 1 2 3 4 3 2 1 2 1 ]
11:  [ 1 2 3 2 3 4 3 2 1 ]
12:  [ 1 2 3 4 3 2 3 2 1 ]
13:  [ 1 2 3 4 3 4 3 2 1 ]
14:  [ 1 2 3 4 5 4 3 2 1 ]
(End)
		

Crossrefs

Cf. A049346 (g.f.: 1 - 1/G(0), where G(k)= 1 + q^(k+1) / (1 - q^(k+1)/G(k+1) ) ).
Cf. A226728 (g.f.: 1/G(0), where G(k) = 1 + q^(k+1) / (1 - q^(k+1)/G(k+2) ) ).
Cf. A226729 (g.f.: 1/G(0), where G(k) = 1 - q^(k+1) / (1 - q^(k+1)/G(k+2) ) ).
Cf. A006958 (g.f.: 1/G(0), where G(k) = 1 - q^(k+1) / (1 - q^(k+1)/G(k+1) ) ).
Cf. A227309 (g.f.: 1/G(0), where G(k) = 1 - q^(k+1) / (1 - q^(k+2)/G(k+1) ) ).

Programs

  • PARI
    N = 66;  q = 'q + O('q^N);
    G(k) = if(k>N, 1, 1 + (-q)^(k+1) / (1 - (-q)^(k+1) / G(k+1) ) );
    gf = 1 / G(0);
    Vec(gf)
    
  • PARI
    N = 66;  q = 'q + O('q^N);
    F(q,y,k) = if(k>N, 1, 1/(1 - y*q^2 * F(q, q^2*y, k+1) ) );
    Vec( 1 + q * F(q,q,0) ) \\ Joerg Arndt, Mar 09 2014

Formula

a(0) = 1 and a(n) = abs(A049346(n)) for n>=1.
G.f.: 1/ (1-q/(1+q/ (1+q^2/(1-q^2/ (1-q^3/(1+q^3/ (1+q^4/(1-q^4/ (1-q^5/(1+q^5/ (1+-...) )) )) )) )) )).
G.f.: 1 + q * F(q,q) where F(q,y) = 1/(1 - y * q^2 * F(q, q^2*y) ); cf. A005169 and p. 841 of the Odlyzko/Wilf reference; 1/(1 - q * F(q,q)) is the g.f. of A143951. - Joerg Arndt, Mar 09 2014
G.f.: 1 + q/(1 - q^3/(1 - q^5/(1 - q^7/ (...)))) (from formulas above). - Joerg Arndt, Mar 09 2014
G.f.: F(x, x^2) where F(x,y) is the g.f. of A239927. - Joerg Arndt, Mar 29 2014
a(n) ~ c * d^n, where d = 1.23729141259673487395949649334678514763130846902468... and c = 0.0773368373684184197215007198148835507944051447907... - Vaclav Kotesovec, Sep 05 2017
G.f.: A(x) = 2 -1/A143951(x). - R. J. Mathar, Aug 23 2018

A117641 Number of 3-Motzkin paths of length n with no level steps at height 0.

Original entry on oeis.org

1, 0, 1, 3, 11, 42, 167, 684, 2867, 12240, 53043, 232731, 1031829, 4615542, 20805081, 94410363, 430945739, 1977366192, 9115261211, 42195093993, 196060049129, 914110333422, 4275222950221, 20051858039718, 94294269673861
Offset: 0

Author

Louis Shapiro, Apr 10 2006

Keywords

Comments

Hankel transform of this sequence forms A000012 = [1,1,1,1,1,...]. - Philippe Deléham, Oct 24 2007

Examples

			The a(4) = 11 paths are UUDD, UDUD and 9 of the form UXYD where each of X and Y are level steps in any of three colors.
		

Programs

  • Magma
    R:=PowerSeriesRing(Rationals(), 30); Coefficients(R!( (1+3*x-Sqrt(1-6*x+5*x^2))/(2*x*(3+x)) )); // G. C. Greubel, Apr 04 2019
    
  • Mathematica
    CoefficientList[ Series[(1 + 3x - Sqrt[1 - 6x + 5x^2])/(2x^2 + 6x), {x, 0, 25}], x] (* Robert G. Wilson v *)
  • Maxima
    a(n):=sum(3^(n-2*j)*binomial(n+1,j)*binomial(n-j-1,n-2*j),j,0,floor(n/2))/(n+1); /*  Vladimir Kruchinin, Apr 04 2019 */
    
  • PARI
    my(x='x+O('x^30)); Vec( (1+3*x-sqrt(1-6*x+5*x^2))/(2*x*(3+x)) ) \\ G. C. Greubel, Apr 04 2019
    
  • Sage
    ((1+3*x-sqrt(1-6*x+5*x^2))/(2*x*(3+x))).series(x, 30).coefficients(x, sparse=False) # G. C. Greubel, Apr 04 2019

Formula

G.f.: (1 +3*x -sqrt(1 -6*x +5*x^2))/(2*x*(3+x)).
G.f. as continued fraction is 1/(1-0*x-x^2/(1-3*x-x^2/(1-3*x-x^2/(1-3*x-x^2/(.....))))). - Paul Barry, Dec 02 2008
a(n) = A126970(n,0). - Philippe Deléham, Nov 24 2009
a(n) = Sum_{k=0..n} A091965(n,k)*(-3)^k. - Philippe Deléham, Nov 28 2009
a(n) = Sum_{k=1..n} Sum_{j=0..floor((n-2*k)/2)} 3^(n-2*k-2*j)*(k/(k+2*j))*binomial(k+2*j,j)*binomial(n-k-1,n-2*k-2*j). - José Luis Ramírez Ramírez, Mar 22 2012
D-finite with recurrence: 3*(n+1)*a(n) +(-17*n+10)*a(n-1) +9*(n-3)*a(n-2) +5*(n-2)*a(n-3)=0. - R. J. Mathar, Dec 02 2012
a(n) ~ 5^(n+3/2) / (32 * sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Feb 13 2014
a(n) = 1/(n+1)*Sum_{j=0..floor(n/2)} 3^(n-2*j)*C(n+1,j)*C(n-j-1,n-2*j). - Vladimir Kruchinin, Apr 04 2019

A129176 Irregular triangle read by rows: T(n,k) is the number of Dyck words of length 2n having k inversions (n >= 0, k >= 0).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 3, 3, 3, 1, 1, 1, 2, 3, 5, 5, 7, 7, 6, 4, 1, 1, 1, 2, 3, 5, 7, 9, 11, 14, 16, 16, 17, 14, 10, 5, 1, 1, 1, 2, 3, 5, 7, 11, 13, 18, 22, 28, 32, 37, 40, 44, 43, 40, 35, 25, 15, 6, 1, 1, 1, 2, 3, 5, 7, 11, 15, 20, 26, 34, 42, 53, 63, 73, 85, 96, 106, 113, 118, 118, 115, 102, 86, 65, 41, 21, 7, 1
Offset: 0

Author

Emeric Deutsch, Apr 11 2007

Keywords

Comments

A Dyck word of length 2n is a word of n 0's and n 1's for which no initial segment contains more 1's than 0's.
Representing a Dyck word p of length 2n as a superdiagonal Dyck path p', the number of inversions of p is equal to the area between p' and the path that corresponds to the Dyck word 0^n 1^n.
Row n has 1+n(n-1)/2 terms. Row sums are the Catalan numbers (A000108). Alternating row sums for n>=1 are the Catalan numbers alternated with 0's (A097331). Sum(k*T(n,k),k>=0) = A029760(n-2).
This triangle is A129182 (area under Dyck paths), reflected and compressed (0's removed). Equivalently, A239927 rotated by Pi/2 clockwise and compressed.
This is also the number of Catalan paths of length n and area k. - N. J. A. Sloane, Nov 28 2011
From Alford Arnold, Jan 29 2008:
This triangle gives the partial sums of the following triangle A136624:
1
.1
....2...1
........2...3...3...1
............2...2...6...7...6...4...1
................2...2...4...8..12..15..17..14..10...5...1
etc.

Examples

			T(4,5) = 3 because we have 01010011, 01001101 and 00110101.
Triangle starts:
[0] 1;
[1] 1;
[2] 1, 1;
[3] 1, 1, 2, 1;
[4] 1, 1, 2, 3, 3, 3, 1;
[5] 1, 1, 2, 3, 5, 5, 7,  7,  6,  4,  1;
[6] 1, 1, 2, 3, 5, 7, 9, 11, 14, 16, 16, 17, 14, 10, 5, 1;
...
		

Crossrefs

Mirror image of A227543.

Programs

  • Maple
    P[0]:=1: for n from 0 to 8 do
    P[n+1]:=sort(expand(sum(t^((i+1)*(n-i))*P[i]*P[n-i],i=0..n))) od:
    for n from 1 to 9 do seq(coeff(P[n],t,j),j=0..n*(n-1)/2) od;
    # yields sequence in triangular form
    # second Maple program:
    b:= proc(x, y, t) option remember; `if`(y<0 or y>x, 0,
          `if`(x=0, 1, expand(b(x-1, y+1, t)*z^t+b(x-1, y-1, t+1))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(2*n, 0$2)):
    seq(T(n), n=0..10);  # Alois P. Heinz, Jun 10 2014
  • Mathematica
    b[x_, y_, t_] := b[x, y, t] = If[y<0 || y>x, 0, If[x == 0, 1, Expand[b[x-1, y+1, t]*z^t + b[x-1, y-1, t+1]]]]; T[n_] := Function[{p}, Table[Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[2*n, 0, 0]]; Table[T[n], {n, 0, 10}] // Flatten (* Jean-François Alcover, May 26 2015, after Alois P. Heinz *)
  • PARI
    P(x, n) =
    {
        if ( n<=1, return(1) );
        return( sum( i=0, n-1, P(x, i) * P(x, n-1 -i) * x^((i+1)*(n-1 -i)) ) );
    }
    for (n=0, 10, print( Vecrev( P(x,n) ) ) ); \\ Joerg Arndt, Jan 23 2024
    
  • PARI
    \\ faster with memoization:
    N=11;
    VP=vector(N+1);  VP[1] =VP[2] = 1;  \\ one-based; memoization
    P(n) = VP[n+1];
    for (n=2, N, VP[n+1] = sum( i=0, n-1, P(i) * P(n-1 -i) * x^((i+1)*(n-1-i)) ) );
    for (n=0, N, print( Vecrev( P(n) ) ) ); \\ Joerg Arndt, Jan 23 2024
  • SageMath
    from sage.combinat.q_analogues import qt_catalan_number
    for n in (0..9): print(qt_catalan_number(n).substitute(q=1).coefficients())
    # Peter Luschny, Mar 10 2020
    

Formula

The row generating polynomials P[n] = P[n](t) satisfy P[0] = 1 and
P[n+1] = Sum_{i=0..n} P[i] P[n-i] t^((i+1)*(n-i)).

A097332 Expansion of (1/(1-x))(1+2x/(1-x+sqrt(1-2x-3x^2))).

Original entry on oeis.org

1, 2, 3, 5, 9, 18, 39, 90, 217, 540, 1375, 3563, 9361, 24872, 66707, 180341, 490913, 1344380, 3701159, 10237541, 28436825, 79288844, 221836403, 622599626, 1752360041, 4945087838, 13988490339, 39658308815, 112666081617
Offset: 0

Author

Paul Barry, Aug 05 2004

Keywords

Comments

Binomial transform of A097331. Binomial transform is A014318. Partial sums of 1+2x/(1-x+sqrt(1-2x-3x^2)) or (1+x+sqrt(1-2x-3x^2))/(1-x+sqrt(1-2x-3x^2)), which is A001006 with an extra leading 1.
Apparently the Motzkin transform of 1, 2, bar(1, -1, -1, 1), where bar() denotes a periodically continued series, as in A057077. - R. J. Mathar, Dec 11 2008
Starting with offset 1 = iterates of M * [1,1,0,0,0,...] where M = a tridiagonal matrix with [1,1,1,...] in the main and superdiagonals and [0,1,1,1,...] in the subdiagonal. - Gary W. Adamson, Jan 08 2009
Hankel transform is A087960(n) = (-1)^binomial(n+1,2). - Paul Barry, Aug 10 2009

Examples

			G.f. = 1 + 2*x + 3*x^2 + 5*x^3 + 9*x^4 + 18*x^5 + 39*x^6 + 90*x^7 + 217*x^8 + ...
		

Programs

  • Mathematica
    CoefficientList[Series[1/(1-x)*(1+(2x)/(1-x+Sqrt[1-2x-3x^2])),{x,0,40}],x] (* Harvey P. Dale, May 03 2012 *)
    a[ n_] := SeriesCoefficient[ (1 + x - Sqrt[1 - 2 x - 3 x^2]) / (2 x (1 - x)), {x, 0, n}]; (* Michael Somos, May 19 2014 *)
  • PARI
    {a(n) = if( n<0, 0, polcoeff( (1 + x - sqrt(1 - 2*x - 3*x^2 + x^2 * O(x^n))) / (2 * x * (1 - x)), n))}; /* Michael Somos, May 19 2014 */

Formula

a(n) = Sum_{k=0..n} (-1)^(n+k)*binomial(n, k)*Sum_{i=0..k} Catalan(k-i)*2^i.
G.f.: 1/(1-x-x/(1+x/(1-x+x/(1-x/(1-x-x/(1+x/(1-x+x/(1-x/(1-x-x/(1+... (continued fraction). - Paul Barry, Aug 10 2009
Conjecture D-finite with recurrence: (n+1)*a(n) - 3*n*a(n-1) + (-n+5)*a(n-2) + 3*(n-2)*a(n-3) = 0. - R. J. Mathar, Nov 26 2012
a(n) ~ 3^(n+3/2) / (4 * sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Feb 13 2014
0 = a(n)*(9*a(n+1) + 6*a(n+2) - 27*a(n+3) + 12*a(n+4)) + a(n+1)*(-12*a(n+1) + 10*a(n+2) + 12*a(n+3) - 7*a(n+4)) + a(n+2)*(-12*a(n+2) + 14*a(n+3) - 6*a(n+4)) + a(n+3)*(a(n+4)). - Michael Somos, May 19 2014
Showing 1-10 of 12 results. Next