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.

Previous Showing 21-30 of 39 results. Next

A015106 Carlitz-Riordan q-Catalan numbers (recurrence version) for q=-9.

Original entry on oeis.org

1, 1, -8, -665, 483544, 3173511682, -187386353065808, -99585165693268026701, 476312561203989614441440600, 20503694883570579788445502041773422, -7943551457092331370323478258038812629918704
Offset: 0

Views

Author

Keywords

Examples

			G.f. = 1 + x - 8*x^2 - 665*x^3 + 483544*x^4 + 3173511682*x^5 + ...
		

Crossrefs

Cf. A227543.
Cf. A015108 (q=-11), A015107 (q=-10), this sequence (q=-9), A015105 (q=-8), A015103 (q=-7), A015102 (q=-6), A015100 (q=-5), A015099 (q=-4), A015098 (q=-3), A015097 (q=-2), A090192 (q=-1), A000108 (q=1), A015083 (q=2), A015084 (q=3), A015085 (q=4), A015086 (q=5), A015089 (q=6), A015091 (q=7), A015092 (q=8), A015093 (q=9), A015095 (q=10), A015096 (q=11).
Column k=9 of A290789.

Programs

  • Mathematica
    m = 11; ContinuedFractionK[If[i == 1, 1, -(-9)^(i - 2) x], 1, {i, 1, m}] + O[x]^m // CoefficientList[#, x]& (* Jean-François Alcover, Nov 17 2019 *)
  • Ruby
    def A(q, n)
      ary = [1]
      (1..n).each{|i| ary << (0..i - 1).inject(0){|s, j| s + q ** j * ary[j] * ary[i - 1 - j]}}
      ary
    end
    def A015106(n)
      A(-9, n)
    end # Seiichi Manyama, Dec 25 2016

Formula

a(n+1) = Sum_{i=0..n} q^i*a(i)*a(n-i) with q=-9 and a(0)=1.
G.f. satisfies: A(x) = 1 / (1 - x*A(-9*x)) = 1/(1-x/(1+9*x/(1-9^2*x/(1+9^3*x/(1-...))))) (continued fraction). - Seiichi Manyama, Dec 28 2016

Extensions

Offset changed to 0 by Seiichi Manyama, Dec 25 2016

A015107 Carlitz-Riordan q-Catalan numbers (recurrence version) for q=-10.

Original entry on oeis.org

1, 1, -9, -919, 917271, 9174563561, -917438025443049, -917439860513400673559, 9174396770273536422744011031, 917439695376166450708460281823359721, -917439693541287252616828116888122637934368489
Offset: 0

Views

Author

Keywords

Examples

			G.f. = 1 + x - 9*x^2 - 919*x^3 + 917271*x^4 + 9174563561*x^5 + ...
		

Crossrefs

Cf. A227543.
Cf. A015108 (q=-11), this sequence (q=-10), A015106 (q=-9), A015105 (q=-8), A015103 (q=-7), A015102 (q=-6), A015100 (q=-5), A015099 (q=-4), A015098 (q=-3), A015097 (q=-2), A090192 (q=-1), A000108 (q=1), A015083 (q=2), A015084 (q=3), A015085 (q=4), A015086 (q=5), A015089 (q=6), A015091 (q=7), A015092 (q=8), A015093 (q=9), A015095 (q=10), A015096 (q=11).
Column k=10 of A290789.

Programs

  • Mathematica
    m = 11; ContinuedFractionK[If[i == 1, 1, -(-10)^(i-2) x], 1, {i, 1, m}] + O[x]^m // CoefficientList[#, x]& (* Jean-François Alcover, Nov 17 2019 *)
  • Ruby
    def A(q, n)
      ary = [1]
      (1..n).each{|i| ary << (0..i - 1).inject(0){|s, j| s + q ** j * ary[j] * ary[i - 1 - j]}}
      ary
    end
    def A015107(n)
      A(-10, n)
    end # Seiichi Manyama, Dec 25 2016

Formula

a(n+1) = Sum_{i=0..n} q^i*a(i)*a(n-i) with q=-10 and a(0)=1.
G.f. satisfies: A(x) = 1 / (1 - x*A(-10*x)) = 1/(1-x/(1+10*x/(1-10^2*x/(1+10^3*x/(1-...))))) (continued fraction). - Seiichi Manyama, Dec 28 2016

Extensions

Offset changed to 0 by Seiichi Manyama, Dec 25 2016

A015108 Carlitz-Riordan q-Catalan numbers (recurrence version) for q=-11.

Original entry on oeis.org

1, 1, -10, -1231, 1636130, 23957879562, -3858392581773300, -6835385537899011365535, 133202313157282627679850238250, 28553099061411464607955930776882965774
Offset: 0

Views

Author

Keywords

Examples

			G.f. = 1 + x - 10*x^2 - 1231*x^3 + 1636130*x^4 + 23957879562*x^5 + ...
		

Crossrefs

Cf. A227543.
Cf. this sequence (q=-11), A015107 (q=-10), A015106 (q=-9), A015105 (q=-8), A015103 (q=-7), A015102 (q=-6), A015100 (q=-5), A015099 (q=-4), A015098 (q=-3), A015097 (q=-2), A090192 (q=-1), A000108 (q=1), A015083 (q=2), A015084 (q=3), A015085 (q=4), A015086 (q=5), A015089 (q=6), A015091 (q=7), A015092 (q=8), A015093 (q=9), A015095 (q=10), A015096 (q=11).
Column k=11 of A290789.

Programs

  • Mathematica
    m = 10; ContinuedFractionK[If[i == 1, 1, -(-11)^(i-2) x], 1, {i, 1, m}] + O[x]^m // CoefficientList[#, x]& (* Jean-François Alcover, Nov 17 2019 *)
  • Ruby
    def A(q, n)
      ary = [1]
      (1..n).each{|i| ary << (0..i - 1).inject(0){|s, j| s + q ** j * ary[j] * ary[i - 1 - j]}}
      ary
    end
    def A015108(n)
      A(-11, n)
    end # Seiichi Manyama, Dec 25 2016

Formula

a(n+1) = Sum_{i=0..n} q^i*a(i)*a(n-i) with q=-11 and a(0)=1.
G.f. satisfies: A(x) = 1 / (1 - x*A(-11*x)) = 1/(1-x/(1+11*x/(1-11^2*x/(1+11^3*x/(1-...))))) (continued fraction). - Seiichi Manyama, Dec 28 2016

Extensions

Offset changed to 0 by Seiichi Manyama, Dec 25 2016

A214247 Number A(n,k) of compositions of n where differences between neighboring parts are in {-k,k}; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 3, 3, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 3, 4, 4, 1, 1, 1, 1, 1, 2, 5, 2, 1, 1, 1, 1, 1, 3, 3, 5, 4, 1, 1, 1, 1, 1, 1, 2, 2, 7, 3, 1, 1, 1, 1, 1, 1, 3, 3, 6, 10, 4, 1, 1, 1, 1, 1, 1, 1, 2, 1, 4, 9, 2
Offset: 0

Views

Author

Alois P. Heinz, Jul 08 2012

Keywords

Examples

			A(5,0) = 2: [5], [1,1,1,1,1].
A(5,1) = 4: [5], [3,2], [2,3], [2,1,2].
A(5,2) = 2: [5], [1,3,1].
A(5,3) = 3: [5], [4,1], [1,4].
Square array A(n,k) begins:
  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
  2,  1,  1,  1,  1,  1,  1,  1,  1, ...
  2,  3,  1,  1,  1,  1,  1,  1,  1, ...
  3,  2,  3,  1,  1,  1,  1,  1,  1, ...
  2,  4,  2,  3,  1,  1,  1,  1,  1, ...
  4,  5,  3,  2,  3,  1,  1,  1,  1, ...
  2,  5,  2,  3,  2,  3,  1,  1,  1, ...
  4,  7,  6,  1,  3,  2,  3,  1,  1, ...
		

Crossrefs

Columns k=0-2 give: A000005, A173258, A214254.
Rows n=0, 1 and main diagonal give: A000012.

Programs

  • Maple
    b:= proc(n, i, k) option remember;
          `if`(n<1 or i<1, 0, `if`(n=i, 1, add(b(n-i, i+j, k), j={-k, k})))
        end:
    A:= (n, k)-> `if`(n=0, 1, add(b(n, j, k), j=1..n)):
    seq(seq(A(n, d-n), n=0..d), d=0..15);
  • Mathematica
    b[n_, i_, k_] := b[n, i, k] = If[n < 1 || i < 1, 0, If[n == i, 1, Sum[b[n - i, i + j, k], { j, Union[{-k, k}]}]]]; a[n_, k_] := If[n == 0, 1, Sum[b[n, j, k], {j, 1, n}]]; Table[Table[a[n, d - n], {n, 0, d}], {d, 0, 15}] // Flatten (* Jean-François Alcover, Dec 13 2013, translated from Maple *)
  • PARI
    tri(k) = {(k*(k+1)/2)}
    ra(n) = {(sqrt(1+8*n)-1)/2}
    C(q,n) = {c = if(n<=1, return(1)); return(sum(i=0, n-1, C(q, i) * C(q, n-1-i) * q^((i+1)*(n-1 -i))));}
    Cw_q(i,k) = {return(q^(((k+2)*i)+1) * polrecip(C(q^(2*k),i)))}
    A_qt(k,N) = {1 + sum(i=0,N/(k+1), t^((2*i)+1) * Cw_q(i,k) * (sum(j=0,ra(N+2)+1, prod(u=1,j, sum(v=0,(N-(tri(u)*k))/(k+2), t^((2*v)+1) * q^(((2*v)+1)*u*k) * Cw_q(v,k)))))^2)}
    A_q(k,N) = {my(q='q+O('q^N), Aqt = A_qt(k,N), Aq = 1); for(i=1,poldegree(Aqt,t), Aq += polcoef(Aqt,i,t)/(1-q^i)); Aq}
    A214247_array(maxrow,maxcolumn) = {my(m=concat([1],vector(maxrow,n,numdiv(n)))~); for(k=1,maxcolumn, m = matconcat([m,Vec(A_q(k,maxrow))~])); m}
    A214247_array(10,10) \\ John Tyler Rascoe, Oct 15 2024

Formula

G.f. for column k > 0: A(k,q) is A(k,q,t) = Sum_{n,m>=0} (q^n)*(t^m) under the transform (q^n)*(t^m) -> (q^n)/(1-q^m) for all m > 0 where A(k,q,t) = 1 + Sum_{i>=0} ( t^((2*i)+1) * Cw(i,k,q) * (Sum_{j>=0} (Product_{u=1..j} (Sum_{v>=0} t^((2*v)+1) * q^(((2*v)+1)*k*u) * Cw(v,k,q))))^2 ), Cw(i,k,q) = q^(((k+2)*i)+1) * Ca(i,q^(2*k)), and Ca(i,q) is the i-th Carlitz-Riordan q-Catalan number (i-th row polynomial of A227543). - John Tyler Rascoe, Sep 13 2024

A239927 Triangle read by rows: T(n,k) is the number of Dyck paths of semilength k such that the area between the x-axis and the path is n (n>=0; 0<=k<=n).

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 3, 0, 1, 0, 0, 0, 1, 0, 4, 0, 1, 0, 0, 0, 0, 3, 0, 5, 0, 1, 0, 0, 0, 1, 0, 6, 0, 6, 0, 1, 0, 0, 0, 0, 3, 0, 10, 0, 7, 0, 1, 0, 0, 0, 0, 0, 7, 0, 15, 0, 8, 0, 1, 0, 0, 0, 0, 2, 0, 14, 0, 21, 0, 9, 0, 1, 0, 0, 0, 0, 0, 7, 0, 25, 0, 28, 0, 10, 0, 1, 0, 0, 0, 0, 1, 0, 17, 0, 41, 0, 36, 0, 11, 0, 1
Offset: 0

Views

Author

Joerg Arndt, Mar 29 2014

Keywords

Comments

Triangle A129182 transposed.
Column sums give the Catalan numbers (A000108).
Row sums give A143951.
Sums along falling diagonals give A005169.
T(4n,2n) = A240008(n). - Alois P. Heinz, Mar 30 2014

Examples

			Triangle begins:
00:  1;
01:  0, 1;
02:  0, 0, 1;
03:  0, 0, 0, 1;
04:  0, 0, 1, 0, 1;
05:  0, 0, 0, 2, 0, 1;
06:  0, 0, 0, 0, 3, 0, 1;
07:  0, 0, 0, 1, 0, 4, 0, 1;
08:  0, 0, 0, 0, 3, 0, 5, 0, 1;
09:  0, 0, 0, 1, 0, 6, 0, 6, 0, 1;
10:  0, 0, 0, 0, 3, 0, 10, 0, 7, 0, 1;
11:  0, 0, 0, 0, 0, 7, 0, 15, 0, 8, 0, 1;
12:  0, 0, 0, 0, 2, 0, 14, 0, 21, 0, 9, 0, 1;
13:  0, 0, 0, 0, 0, 7, 0, 25, 0, 28, 0, 10, 0, 1;
14:  0, 0, 0, 0, 1, 0, 17, 0, 41, 0, 36, 0, 11, 0, 1;
15:  0, 0, 0, 0, 0, 5, 0, 35, 0, 63, 0, 45, 0, 12, 0, 1;
16:  0, 0, 0, 0, 1, 0, 16, 0, 65, 0, 92, 0, 55, 0, 13, 0, 1;
17:  0, 0, 0, 0, 0, 5, 0, 40, 0, 112, 0, 129, 0, 66, 0, 14, 0, 1;
18:  0, 0, 0, 0, 0, 0, 16, 0, 86, 0, 182, 0, 175, 0, 78, 0, 15, 0, 1;
19:  0, 0, 0, 0, 0, 3, 0, 43, 0, 167, 0, 282, 0, 231, 0, 91, 0, 16, 0, 1;
20:  0, 0, 0, 0, 0, 0, 14, 0, 102, 0, 301, 0, 420, 0, 298, 0, 105, 0, 17, 0, 1;
...
Column k=4 corresponds to the following 14 paths (dots denote zeros):
#:         path              area   steps (Dyck word)
01:  [ . 1 . 1 . 1 . 1 . ]     4     + - + - + - + -
02:  [ . 1 . 1 . 1 2 1 . ]     6     + - + - + + - -
03:  [ . 1 . 1 2 1 . 1 . ]     6     + - + + - - + -
04:  [ . 1 . 1 2 1 2 1 . ]     8     + - + + - + - -
05:  [ . 1 . 1 2 3 2 1 . ]    10     + - + + + - - -
06:  [ . 1 2 1 . 1 . 1 . ]     6     + + - - + - + -
07:  [ . 1 2 1 . 1 2 1 . ]     8     + + - - + + - -
08:  [ . 1 2 1 2 1 . 1 . ]     8     + + - + - - + -
09:  [ . 1 2 1 2 1 2 1 . ]    10     + + - + - + - -
10:  [ . 1 2 1 2 3 2 1 . ]    12     + + - + + - - -
11:  [ . 1 2 3 2 1 . 1 . ]    10     + + + - - - + -
12:  [ . 1 2 3 2 1 2 1 . ]    12     + + + - - + - -
13:  [ . 1 2 3 2 3 2 1 . ]    14     + + + - + - - -
14:  [ . 1 2 3 4 3 2 1 . ]    16     + + + + - - - -
There are no paths with weight < 4, one with weight 4, none with weight 5, 3 with weight 6, etc., therefore column k=4 is
[0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 3, 0, 2, 0, 1, 0, 1, 0, 0, 0, ...].
Row n=8 is [0, 0, 0, 0, 3, 0, 5, 0, 1], the corresponding paths of weight=8 are:
Semilength 4:
  [ . 1 . 1 2 1 2 1 . ]
  [ . 1 2 1 . 1 2 1 . ]
  [ . 1 2 1 2 1 . 1 . ]
Semilength 6:
  [ . 1 . 1 . 1 . 1 . 1 2 1 . ]
  [ . 1 . 1 . 1 . 1 2 1 . 1 . ]
  [ . 1 . 1 . 1 2 1 . 1 . 1 . ]
  [ . 1 . 1 2 1 . 1 . 1 . 1 . ]
  [ . 1 2 1 . 1 . 1 . 1 . 1 . ]
Semilength 8:
  [ . 1 . 1 . 1 . 1 . 1 . 1 . 1 . 1 . ]
		

Crossrefs

Sequences obtained by particular choices for x and y in the g.f. F(x,y) are: A000108 (F(1, x)), A143951 (F(x, 1)), A005169 (F(sqrt(x), sqrt(x))), A227310 (1+x*F(x, x^2), also 2-1/F(x, 1)), A239928 (F(x^2, x)), A052709 (x*F(1,x+x^2)), A125305 (F(1, x+x^3)), A002212 (F(1, x/(1-x))).
Cf. A129181.

Programs

  • Maple
    b:= proc(x, y, k) option remember;
          `if`(y<0 or y>x or k<0, 0, `if`(x=0, `if`(k=0, 1, 0),
           b(x-1, y-1, k-y+1/2)+ b(x-1, y+1, k-y-1/2)))
        end:
    T:= (n, k)-> b(2*k, 0, n):
    seq(seq(T(n, k), k=0..n), n=0..20);  # Alois P. Heinz, Mar 29 2014
  • Mathematica
    b[x_, y_, k_] := b[x, y, k] = If[y<0 || y>x || k<0, 0, If[x == 0, If[k == 0, 1, 0], b[x-1, y-1, k-y+1/2] + b[x-1, y+1, k-y-1/2]]]; T[n_, k_] := b[2*k, 0, n]; Table[ Table[T[n, k], {k, 0, n}], {n, 0, 20}] // Flatten (* Jean-François Alcover, Feb 18 2015, after Alois P. Heinz *)
  • PARI
    rvec(V) = { V=Vec(V); my(n=#V); vector(n, j, V[n+1-j] ); }
    print_triangle(V)= { my( N=#V ); for(n=1, N, print( rvec( V[n]) ) ); }
    N=20; x='x+O('x^N);
    F(x,y, d=0)=if (d>N, 1, 1 / (1-x*y * F(x, x^2*y, d+1) ) );
    v= Vec( F(x,y) );
    print_triangle(v)

Formula

G.f.: F(x,y) satisfies F(x,y) = 1 / (1 - x*y * F(x, x^2*y) ).
G.f.: 1/(1 - y*x/(1 - y*x^3/(1 - y*x^5/(1 - y*x^7/(1 - y*x^9/( ... )))))).

A238875 Subdiagonal partitions: number of partitions (p1, p2, p3, ...) of n with pi <= i.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 5, 7, 10, 15, 18, 26, 35, 47, 61, 80, 103, 138, 175, 224, 283, 362, 455, 577, 721, 898, 1111, 1380, 1701, 2106, 2577, 3156, 3844, 4680, 5671, 6879, 8312, 10034, 12060, 14478, 17319, 20715, 24703, 29442, 35004, 41578, 49247, 58278, 68796, 81132, 95502, 112320, 131877, 154705, 181158, 211908, 247475
Offset: 0

Views

Author

Joerg Arndt, Mar 24 2014

Keywords

Comments

The partitions are represented as weakly increasing lists of parts.
Partitions with subdiagonal growth (A238876) with first part = 1.

Examples

			The a(11) = 26 such partitions of 11 are:
  01:  [ 1 1 1 1 1 1 1 1 1 1 1 ]
  02:  [ 1 1 1 1 1 1 1 1 1 2 ]
  03:  [ 1 1 1 1 1 1 1 1 3 ]
  04:  [ 1 1 1 1 1 1 1 2 2 ]
  05:  [ 1 1 1 1 1 1 1 4 ]
  06:  [ 1 1 1 1 1 1 2 3 ]
  07:  [ 1 1 1 1 1 1 5 ]
  08:  [ 1 1 1 1 1 2 2 2 ]
  09:  [ 1 1 1 1 1 2 4 ]
  10:  [ 1 1 1 1 1 3 3 ]
  11:  [ 1 1 1 1 1 6 ]
  12:  [ 1 1 1 1 2 2 3 ]
  13:  [ 1 1 1 1 2 5 ]
  14:  [ 1 1 1 1 3 4 ]
  15:  [ 1 1 1 2 2 2 2 ]
  16:  [ 1 1 1 2 2 4 ]
  17:  [ 1 1 1 2 3 3 ]
  18:  [ 1 1 1 3 5 ]
  19:  [ 1 1 1 4 4 ]
  20:  [ 1 1 2 2 2 3 ]
  21:  [ 1 1 2 2 5 ]
  22:  [ 1 1 2 3 4 ]
  23:  [ 1 1 3 3 3 ]
  24:  [ 1 2 2 2 2 2 ]
  25:  [ 1 2 2 2 4 ]
  26:  [ 1 2 2 3 3 ]
		

Crossrefs

Cf. A008930 (subdiagonal compositions), A010054 (subdiagonal partitions into distinct parts).
Cf. A219282 (superdiagonal compositions), A238873 (superdiagonal partitions), A238394 (strictly superdiagonal partitions), A238874 (strictly superdiagonal compositions), A025147 (strictly superdiagonal partitions into distinct parts).
Cf. A238859 (compositions of n with subdiagonal growth), A238876 (partitions with subdiagonal growth), A001227 (partitions into distinct parts with subdiagonal growth).
Cf. A238860 (partitions with superdiagonal growth), A238861 (compositions with superdiagonal growth), A000009 (partitions into distinct parts have superdiagonal growth by definition).
Cf. A129176 and A227543.

Programs

  • PARI
    \\ here b: nr parts; k: max part, b+w-1: partition sum.
    seq(n)={my(M=matrix(n,1), v=vector(n+1)); M[1,1]=v[1]=v[2]=1; for(b=2, n, M=matrix(n-b+1,b,w,k, if(w>=k, sum(j=1, min(b-1,k), M[w+1-k,j]))); v+=concat(vector(b),vecsum(Vec(M))~)); v} \\ Andrew Howroyd, Jan 19 2024
    
  • PARI
    N=55;
    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)) ) );
    x='x+O('x^N);
    A(x) = sum(n=0, N, x^n * P(n) );
    Vec(A(x)) \\ Joerg Arndt, Jan 23 2024

Formula

G.f.: Sum_{n>=0} x^n * P(n) where P(n) is the row polynomial of the n-th row of A129176. This works because A129176(j,k) is also the number of subdiagonal partitions of j+k with j parts. - John Tyler Rascoe, Jan 20 2024

A129175 Triangle read by rows: MacMahon's q-analog of the Catalan numbers.

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 2, 1, 2, 1, 2, 1, 1, 0, 1, 1, 0, 1, 1, 2, 2, 3, 2, 4, 3, 4, 3, 4, 2, 3, 2, 2, 1, 1, 0, 1, 1, 0, 1, 1, 2, 2, 4, 3, 5, 5, 7, 6, 9, 7, 9, 8, 9, 7, 9, 6, 7, 5, 5, 3, 4, 2, 2, 1, 1, 0, 1, 1, 0, 1, 1, 2, 2, 4, 4, 6, 6, 9, 9, 13, 12, 16, 16, 19, 18, 22, 20, 23, 21, 23
Offset: 0

Views

Author

Emeric Deutsch, Apr 20 2007

Keywords

Comments

Previous name: T(n,k) is the number of Dyck words of length 2n having major index k (n >= 0, k >= 0). 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. The major index of a Dyck word is the sum of the positions of those 1's that are followed by a 0.
Representing a Dyck word p of length 2n as a Dyck path p', the major index of p is equal to the sum of the abscissae of the valleys of p'.
Row n has 1+n*(n-1) terms.
Row sums are the Catalan numbers (A000108).
T(n,k) = T(n,n^2-n-k) (i.e., rows are palindromic).
Alternating row sums are the central binomial coefficients binomial(n, floor(n/2)) = A001405(n).
Sum_{k=0..n*(n-1)} k*T(n,k) = A002740(n+1).
T(n,k) = A129174(n,n+k) (i.e., except for the initial 0's, rows of A129174 and A129175 are the same).
For another q-analog of the Catalan numbers, due to Carlitz and Riordan, that enumerates Dyck paths by an area statistic see A227543. - Peter Bala, Feb 28 2023

Examples

			T(4,8)=2 because we have 01001101 (with 10's starting at positions 2 and 6) and 00101011 (with 10's starting at positions 3 and 5).
Triangle starts:
  1;
  1;
  1,0,1;
  1,0,1,1,1,0,1;
  1,0,1,1,2,1,2,1,2,1,1,0,1;
  1,0,1,1,2,2,3,2,4,3,4,3,4,2,3,2,2,1,1,0,1;
		

References

  • G. E. Andrews, The Theory of Partitions, Addison-Wesley, 1976.
  • P. A. MacMahon, Combinatory analysis, Two volumes (bound as one), Chelsea Publishing Co., New York, 1960 (see p. 214).
  • R. P. Stanley, Enumerative Combinatorics, Cambridge, Vol. 2, 1999; see p. 236, Exercise 6.34 b. [From Emeric Deutsch, Nov 05 2008]

Crossrefs

Programs

  • Maple
    br:=n->sum(q^i,i=0..n-1): f:=n->product(br(j),j=1..n): cbr:=(n,k)->f(n)/f(k)/f(n-k): P:=n->sort(expand(simplify(cbr(2*n,n)/br(n+1)))): for n from 0 to 7 do seq(coeff(P(n),q,k),k=0..n*(n-1)) 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, true)+b(x-1, y+1, false)*`if`(t, z^x, 1))))
        end:
    T:= n-> (p-> seq(coeff(p, z, i), i=0..degree(p)))(b(2*n, 0, false)):
    seq(T(n), n=0..8);  # Alois P. Heinz, Sep 15 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, True] + b[x-1, y+1, False]*If[t, z^x, 1]]]]; T[n_] := Function[{p}, Table[ Coefficient[p, z, i], {i, 0, Exponent[p, z]}]][b[2*n, 0, False]]; Table[T[n], {n, 0, 8}] // Flatten (* Jean-François Alcover, May 26 2015, after Alois P. Heinz *)
    p[n_] := QBinomial[2n,n,q]/QBinomial[n+1,1,q]; Table[CoefficientList[p[n] // FunctionExpand, q], {n,0,9}] // Flatten (* Peter Luschny, Jul 22 2016 *)
  • Sage
    from sage.combinat.q_analogues import q_catalan_number
    def T(n): return list(q_catalan_number(n))
    for n in (0..6): print(T(n)) # Peter Luschny, Jul 19 2016

Formula

The generating polynomial for row n is P[n](t) = binomial[2n,n]/[n+1], where [n+1]=1+t+t^2+...+t^n and binomial[2n,n] is a Gaussian polynomial (due to MacMahon).

Extensions

New name from Peter Luschny, Jul 24 2016

A138158 Triangle read by rows: T(n,k) is the number of ordered trees with n edges and path length k; 0 <= k <= n(n+1)/2.

Original entry on oeis.org

1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 2, 1, 1, 0, 0, 0, 0, 1, 3, 3, 3, 2, 1, 1, 0, 0, 0, 0, 0, 1, 4, 6, 7, 7, 5, 5, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 1, 5, 10, 14, 17, 16, 16, 14, 11, 9, 7, 5, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 6, 15, 25, 35, 40, 43, 44, 40, 37, 32, 28, 22, 18, 13, 11, 7, 5, 3, 2, 1, 1
Offset: 0

Views

Author

Emeric Deutsch, Mar 21 2008

Keywords

Comments

T(n,k) is the number of Dyck paths of semilength n for which the sum of the heights of the vertices that terminate an upstep (i.e. peaks and doublerises) is k. Example: T(4,7)=3 because we have UUDUDUDD, UDUUUDDD and UUUDDDUD.
See related triangle A227543.
Row n contains 1+n(n+1)/2 terms.
The maximum in each row of the triangle is A274291. - Torsten Muetze, Nov 28 2018
It appears that for j = 0,1,...,n-1 the first j terms of the rows in reversed order are given by A000041(j), the partition numbers. - Geoffrey Critzer, Jul 14 2020

Examples

			T(2,2)=1 because /\ is the only ordered tree with 2 edges and path length 2.
Triangle starts
 1,
 0, 1,
 0, 0, 1, 1,
 0, 0, 0, 1, 2, 1, 1,
 0, 0, 0, 0, 1, 3, 3, 3, 2, 1, 1,
 0, 0, 0, 0, 0, 1, 4, 6, 7, 7, 5, 5, 3, 2, 1, 1,
 0, 0, 0, 0, 0, 0, 1, 5, 10, 14, 17, 16, 16, 14, 11, 9, 7, 5, 3, 2, 1, 1,
 0, 0, 0, 0, 0, 0, 0, 1, 6, 15, 25, 35, 40, 43, 44, 40, 37, 32, 28, 22, 18, 13, 11, 7, 5, 3, 2, 1, 1,
... [_Joerg Arndt_, Feb 21 2014]
		

Crossrefs

Programs

  • Maple
    P[0]:=1: for n to 7 do P[n]:=sort(expand(t*(sum(P[j]*P[n-j-1]*t^(n-j-1),j= 0.. n-1)))) end do: for n from 0 to 7 do seq(coeff(P[n], t, j),j=0..(1/2)*n*(n+1)) end do; # yields sequence in triangular form
  • Mathematica
    nmax = 7;
    P[0] = 1; P[n_] := P[n] = t*Sum[P[j]*P[n-j-1]*t^(n-j-1), {j, 0, n-1}];
    row[n_] := row[n] = CoefficientList[P[n] + O[t]^(n(n+1)/2 + 1), t];
    T[n_, k_] := row[n][[k+1]];
    Table[T[n, k], {n, 0, nmax}, {k, 0, n(n+1)/2}] // Flatten (* Jean-François Alcover, Jul 11 2018, from Maple *)
    nn = 10; f[z_, u_] := Sum[Sum[a[n, k] u^k z^n, {k, 0, Binomial[n, 2]}], {n, 1, nn}]; sol = SolveAlways[Series[0 == f[z, u] - z/(1 - f[u z, u]) , {z, 0, nn}], {z, u}];Level[Table[Table[a[n, k], {k, 0, Binomial[n, 2]}], {n, 1, nn}] /.
    sol, {2}] // Grid (* Geoffrey Critzer, Jul 14 2020 *)

Formula

G.f. G(t,z) satisfies G(t,z) = 1+t*z*G(t,z)*G(t,t*z).
Row generating polynomials P[n]=P[n](t) are given by P[0]=1, P[n] = t * Sum( P[j]*P[n-j-1]*t^(n-1-j), j=0..n-1 ) (n>=1).
Row sums are the Catalan numbers (A000108).
Sum of entries in column n = A005169(n).
Sum_{k=0..n(n+1)/2} k*T(n,k) = A000346(n-1).
T(n,k) = A047998(k,n).
G.f.: 1/(1 - x*y/(1 - x*y^2/(1 - x*y^3/(1 - x*y^4/(1 - x*y^5)/(1 - ... ))))), a continued fraction. - Ilya Gutkovskiy, Apr 21 2017

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

Views

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

A145855 Number of n-element subsets of {1,2,...,2n-1} whose elements sum to a multiple of n.

Original entry on oeis.org

1, 1, 4, 9, 26, 76, 246, 809, 2704, 9226, 32066, 112716, 400024, 1432614, 5170604, 18784169, 68635478, 252085792, 930138522, 3446167834, 12815663844, 47820414962, 178987624514, 671825133644, 2528212128776, 9536894664376
Offset: 1

Views

Author

T. D. Noe, Oct 21 2008, Oct 22 2008, Oct 24 2008

Keywords

Comments

It is easy to see that {1,2,...,2n-1} can be replaced by any 2n-1 consecutive numbers and the results will be the same. Erdos, Ginzburg and Ziv proved that every set of 2n-1 numbers -- not necessarily consecutive -- contains a subset of n elements whose sum is a multiple of n.

Examples

			a(3)=4 because, of the 10 3-element subsets of 1..7, only {1,2,3}, {1,3,5}, {2,3,4} and {3,4,5} have sums that are multiples of 3.
L.g.f.: L(x) = x + x^2/2 + 4*x^3/3 + 9*x^4/4 + 26*x^5/5 + 76*x^6/6 + 246*x^7/7 +...
where exponentiation yields the g.f. of A000571:
exp(L(x)) = 1 + x + x^2 + 2*x^3 + 4*x^4 + 9*x^5 + 22*x^6 + 59*x^7 + 167*x^8 +...
		

Crossrefs

Column k=2 of A309148.

Programs

  • Mathematica
    Table[Length[Select[Plus@@@Subsets[Range[2n-1],{n}], Mod[ #,n]==0&]], {n,10}]
    Table[d=Divisors[n]; Sum[(-1)^(n+d[[i]]) EulerPhi[n/d[[i]]] Binomial[2d[[i]], d[[i]]]/2/n, {i,Length[d]}], {n,30}] (* T. D. Noe, Oct 24 2008 *)
  • PARI
    {a(n)=sumdiv(n, d, (-1)^(n+d)*eulerphi(n/d)*binomial(2*d, d)/(2*n))}
    
  • PARI
    {A227532(n, k)=local(G=1); for(i=1, n, G=1+x*subst(G, x, q*x)*G +x*O(x^n)); n*polcoeff(polcoeff(log(G), n, x), k, q)}
    {a(n)=sum(k=0,n\2, A227532(n, n*k))} \\ Paul D. Hanna, Jul 17 2013

Formula

a(n) = (1/(2*n))*Sum_{d|n} (-1)^(n+d)*phi(n/d)*binomial(2*d,d). Conjectured by Vladeta Jovovic, Oct 22 2008; proved by Max Alekseyev, Oct 23 2008 (see link).
a(2n+1) = A003239(2n+1) and a(2n) = A003239(2n) - A003239(d), where d is the largest odd divisor of n. - T. D. Noe, Oct 24 2008
a(n) = Sum_{d|n} (-1)^(n+d)*d*A131868(d). - Vladeta Jovovic, Oct 28 2008
a(n) = Sum_{k=0..[n/2]} A227532(n,n*k), where A227532 is the logarithmic derivative, wrt x, of the g.f. G(x,q) = 1 + x*G(q*x,q)*G(x,q) of triangle A227543. - Paul D. Hanna, Jul 17 2013
Logarithmic derivative of A000571, the number of different scores that are possible in an n-team round-robin tournament. - Paul D. Hanna, Jul 17 2013
G.f.: -Sum_{m >= 1} (phi(m)/m) * log((1 + sqrt(1 + 4*(-y)^m))/2). - Petros Hadjicostas, Jul 15 2019
a(n) ~ 2^(2*n-1) / (sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Mar 28 2023

Extensions

Extension T. D. Noe, Oct 24 2008
Previous Showing 21-30 of 39 results. Next