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

A203717 A Catalan triangle by rows.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 8, 4, 1, 1, 20, 15, 5, 1, 1, 50, 53, 21, 6, 1, 1, 126, 182, 84, 28, 7, 1, 1, 322, 616, 326, 120, 36, 8, 1, 1, 834, 2070, 1242, 495, 165, 45, 9, 1, 1, 2187, 6930, 4680, 1997, 715, 220, 55, 10, 1, 1, 5797, 23166, 17512, 7942, 3003, 1001, 286, 66, 11, 1
Offset: 1

Views

Author

Gary W. Adamson, Jan 04 2012

Keywords

Comments

Row sums = the Catalan sequence starting with offset 1: (1, 2, 5, 14, 42,...).
T(n,k) is the number of Dyck n-paths whose maximum ascent length is k. - David Scambler, Aug 22 2012
T(n,k) is the number of ordered rooted trees with n non-root nodes and maximal outdegree k. T(4,3) = 4:
. o o o o
. | /|\ /|\ /|\
. o o o o o o o o o o
. /|\ | | |
. o o o o o o - Alois P. Heinz, Jun 29 2014
T(n,k) also is the number of permutations p of [n] such that in 0p the largest up-jump equals k and no down-jump is larger than 1. An up-jump j occurs at position i in p if p_{i} > p_{i-1} and j is the index of p_i in the increasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are larger than p_{i-1}. A down-jump j occurs at position i in p if p_{i} < p_{i-1} and j is the index of p_i in the decreasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are smaller than p_{i-1}. First index in the lists is 1 here. T(4,3) = 4: 1432, 3214, 3241, 3421. - Alois P. Heinz, Aug 29 2017

Examples

			First few rows of the array begin:
1,...1,...1,...1,...1,...;
1,...2,...4,...9,..21,...; = A001006
1,...2,...5,..13,..36,...; = A036765
1,...2,...5,..14,..41,...; = A036766
1,...2,...5,..14,..42,...; = A036767
... Taking finite differences of array terms starting from the top by columns, we obtain row terms of the triangle. First few rows of the triangle are:
  1;
  1,    1;
  1,    3,    1;
  1,    8,    4,    1;
  1,   20,   15,    5,    1;
  1,   50,   53,   21,    6,   1;
  1,  126,  182,   84,   28,   7,   1;
  1,  322,  616,  326,  120,  36,   8,  1;
  1,  834, 2070, 1242,  495, 165,  45,  9,  1;
  1, 2187, 6930, 4680, 1997, 715, 220, 55, 10, 1;
  ...
Example: Row 4 of the triangle = (1, 8, 4, 1) = the finite differences of (1, 9, 13, 14), column 4 of the array. Term (3,4) = 13 of the array is the upper left term of M^4, where M is an infinite square production matrix with four diagonals of 1's starting at (1,2), (1,1), (2,1), and (3,1); with the rest zeros.
		

Crossrefs

Columns k=1-3 give: A057427, A140662(n-1) for n>1, A303271.
T(2n,n) gives A291662.
T(2n+1,n+1) gives A005809.
T(n,ceiling(n/2)) gives A303259.

Programs

  • Maple
    b:= proc(n, t, k) option remember; `if`(n=0, 1, `if`(t>0,
          add(b(j-1, k$2)*b(n-j, t-1, k), j=1..n), b(n-1, k$2)))
        end:
    T:= (n, k)-> b(n, k-1$2) -`if`(k=1, 0, b(n, k-2$2)):
    seq(seq(T(n, k), k=1..n), n=1..14);  # Alois P. Heinz, Jun 29 2014
    # second Maple program:
    b:= proc(u, o, k) option remember; `if`(u+o=0, 1,
          add(b(u-j, o+j-1, k), j=1..min(1, u))+
          add(b(u+j-1, o-j, k), j=1..min(k, o)))
        end:
    T:= (n, k)-> b(0, n, k)-`if`(k=0, 0, b(0, n, k-1)):
    seq(seq(T(n, k), k=1..n), n=1..14);  # Alois P. Heinz, Aug 28 2017
  • Mathematica
    b[n_, t_, k_] := b[n, t, k] = If[n == 0, 1, If[t > 0, Sum[b[j-1, k, k]*b[n - j, t-1, k], {j, 1, n}], b[n-1, k, k]]]; T[n_, k_] := b[n, k-1, k-1] - If[k == 1, 0, b[n, k-2, k-2]]; Table[T[n, k], {n, 1, 14}, {k, 1, n}] // Flatten (* Jean-François Alcover, May 27 2016, after Alois P. Heinz *)
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def b(u, o, k): return 1 if u + o==0 else sum([b(u - j, o + j - 1, k) for j in range(1, min(1, u) + 1)]) + sum([b(u + j - 1, o - j, k) for j in range(1, min(k, o) + 1)])
    def T(n, k): return b(0, n, k) - (0 if k==0 else b(0, n, k - 1))
    for n in range(1, 16): print([T(n, k) for k in range(1, n + 1)]) # Indranil Ghosh, Aug 30 2017

Formula

Finite differences of antidiagonals of an array in which n-th array row is generated from powers of M, extracting successive upper left terms. M for n-th row of the array is an infinite square production matrix composed of (n+1) diagonals of 1's and the rest zeros. Given the upper left term of the array is (1,1), the diagonals begin at (1,2), (1,1), (2,1), (3,1), (4,1),...
T(n,k) = A288942(n,k) - A288942(n,k-1). - Alois P. Heinz, Sep 01 2017

A303697 Number T(n,k) of permutations p of [n] whose difference between sum of up-jumps and sum of down-jumps equals k; triangle T(n,k), n>=0, min(0,1-n)<=k<=max(0,n-1), read by rows.

Original entry on oeis.org

1, 1, 1, 0, 1, 1, 1, 2, 1, 1, 1, 4, 5, 4, 5, 4, 1, 1, 11, 19, 19, 20, 19, 19, 11, 1, 1, 26, 82, 100, 101, 100, 101, 100, 82, 26, 1, 1, 57, 334, 580, 619, 619, 620, 619, 619, 580, 334, 57, 1, 1, 120, 1255, 3394, 4339, 4420, 4421, 4420, 4421, 4420, 4339, 3394, 1255, 120, 1
Offset: 0

Views

Author

Alois P. Heinz, Apr 28 2018

Keywords

Comments

An up-jump j occurs at position i in p if p_{i} > p_{i-1} and j is the index of p_i in the increasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are larger than p_{i-1}. A down-jump j occurs at position i in p if p_{i} < p_{i-1} and j is the index of p_i in the decreasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are smaller than p_{i-1}. First index in the lists is 1 here.

Examples

			Triangle T(n,k) begins:
:                               1                             ;
:                               1                             ;
:                          1,   0,   1                        ;
:                     1,   1,   2,   1,   1                   ;
:                1,   4,   5,   4,   5,   4,   1              ;
:           1,  11,  19,  19,  20,  19,  19,  11,   1         ;
:      1,  26,  82, 100, 101, 100, 101, 100,  82,  26,  1     ;
:  1, 57, 334, 580, 619, 619, 620, 619, 619, 580, 334, 57, 1  ;
		

Crossrefs

Programs

  • Maple
    b:= proc(u, o) option remember; expand(`if`(u+o=0, 1,
          add(b(u-j, o+j-1)*x^(-j), j=1..u)+
          add(b(u+j-1, o-j)*x^( j), j=1..o)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=ldegree(p)..degree(p)))(
            `if`(n=0, 1, add(b(j-1, n-j), j=1..n))):
    seq(T(n), n=0..12);
  • Mathematica
    b[u_, o_] := b[u, o] = Expand[If[u+o == 0, 1,
         Sum[b[u-j, o+j-1] x^-j, {j, 1, u}] +
         Sum[b[u+j-1, o-j] x^j, {j, 1, o}]]];
    T[0] = {1};
    T[n_] := x^n Sum[b[j-1, n-j], {j, 1, n}] // CoefficientList[#, x]& // Rest;
    T /@ Range[0, 12] // Flatten (* Jean-François Alcover, Feb 20 2021, after Alois P. Heinz *)

Formula

T(n,0) = A153229(n) for n > 0.
T(n,1) = A005165(n-1) for n > 0.
T(n+1,n-1) = A000295(n).
T(n,k) = T(n,-k).
Sum_{k=0..n-1} k^2 * T(n,k) = A001720(n+2) for n>1.

A264868 Number of rooted tandem duplication trees on n gene segments.

Original entry on oeis.org

1, 1, 2, 6, 22, 92, 420, 2042, 10404, 54954, 298648, 1660714, 9410772, 54174212, 316038060, 1864781388, 11111804604, 66782160002, 404392312896, 2465100947836, 15116060536540, 93184874448186, 577198134479356, 3590697904513792, 22425154536754776
Offset: 1

Views

Author

Peter Bala, Nov 27 2015

Keywords

Comments

Apparently a(n) is the number of words [d(0)d(1)d(2)...d(n)] where d(k) <= k (so d(0)=0) and if w(k-1) > w(k) then w(k-1) - w(k) = 1 (that is, descents by 2 or more are forbidden). - Joerg Arndt, Jan 26 2024

Examples

			Form _Joerg Arndt_, Jan 26 2024: (Start)
The a(5) = 22 words as described in the comment are (dots denote zeros, leading zeros omitted):
    1:  [ . . . ]
    2:  [ . . 1 ]
    3:  [ . . 2 ]
    4:  [ . . 3 ]
    5:  [ . 1 . ]
    6:  [ . 1 1 ]
    7:  [ . 1 2 ]
    8:  [ . 1 3 ]
    9:  [ . 2 1 ]
   10:  [ . 2 2 ]
   11:  [ . 2 3 ]
   12:  [ 1 . . ]
   13:  [ 1 . 1 ]
   14:  [ 1 . 2 ]
   15:  [ 1 . 3 ]
   16:  [ 1 1 . ]
   17:  [ 1 1 1 ]
   18:  [ 1 1 2 ]
   19:  [ 1 1 3 ]
   20:  [ 1 2 1 ]
   21:  [ 1 2 2 ]
   22:  [ 1 2 3 ]
(End)
		

References

  • Mathematics of Evolution and Phylogeny, O. Gascuel (ed.), Oxford University Press, 2005

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember;
           if n = 1 then 1 elif n = 2 then 1 else add((-1)^(k+1)*
              binomial(n+1-2*k, k)*a(n-k), k = 1..floor((n+1)/3))
           end if;
        end proc:
    seq(a(n), n = 1..24);
  • Mathematica
    a[n_] := a[n] = If[n == 1, 1, If[n == 2, 1, Sum[(-1)^(k+1) Binomial[n+1-2k, k] a[n-k], {k, 1, Floor[(n+1)/3]}]]]; Array[a, 25] (* Jean-François Alcover, May 29 2019 *)
  • Python
    from sympy.core.cache import cacheit
    from sympy import binomial
    @cacheit
    def a(n):
        return 1 if n<3 else sum([(-1)**(k + 1)*binomial(n + 1 - 2*k, k)*a(n - k) for k in range(1, (n + 1)//3 + 1)])
    print([a(n) for n in range(1, 26)]) # Indranil Ghosh, Aug 30 2017

Formula

a(n) = Sum_{k = 1..floor((n + 1)/3)} (-1)^(k + 1)*binomial(n + 1 - 2*k,k)*a(n-k) with a(1) = a(2) = 1 (Yang and Zhang).
For n >= 3, (1/2)*a(n) = A086521(n) is the number of tandem duplication trees on n gene segments.
Main diagonal and row sums of A264869.
a(n) = Sum_{k=0..n-1} A291680(n-1,k). - Alois P. Heinz, Aug 29 2017

A206464 Number of length-n Catalan-RGS (restricted growth strings) such that the RGS is a valid mixed-radix number in falling factorial basis.

Original entry on oeis.org

1, 1, 2, 4, 10, 26, 74, 218, 672, 2126, 6908, 22876, 77100, 263514, 911992, 3189762, 11261448, 40083806, 143713968, 518594034, 1882217168, 6867064856, 25172021144, 92666294090, 342467464612, 1270183943200, 4726473541216, 17640820790092, 66025467919972
Offset: 0

Views

Author

Joerg Arndt, Feb 08 2012

Keywords

Comments

Catalan-RGS are strings with first digit d(0)=zero, and d(k+1) <= d(k)+1, falling factorial mixed-radix numbers have last digit <= 1, second last <= 2, etc.
The digits of the RGS are <= floor(n/2).
The first few terms are the same as for A089429.
Column k=0 of A264869. - Peter Bala, Nov 27 2015
a(n) = A291680(n+1,n+1). - Alois P. Heinz, Aug 29 2017

Examples

			The a(5)=26 strings for n=5 are (dots for zeros):
   1:  [ . . . . . ]
   2:  [ . . . . 1 ]
   3:  [ . . . 1 . ]
   4:  [ . . . 1 1 ]
   5:  [ . . 1 . . ]
   6:  [ . . 1 . 1 ]
   7:  [ . . 1 1 . ]
   8:  [ . . 1 1 1 ]
   9:  [ . . 1 2 . ]
  10:  [ . . 1 2 1 ]
  11:  [ . 1 . . . ]
  12:  [ . 1 . . 1 ]
  13:  [ . 1 . 1 . ]
  14:  [ . 1 . 1 1 ]
  15:  [ . 1 1 . . ]
  16:  [ . 1 1 . 1 ]
  17:  [ . 1 1 1 . ]
  18:  [ . 1 1 1 1 ]
  19:  [ . 1 1 2 . ]
  20:  [ . 1 1 2 1 ]
  21:  [ . 1 2 . . ]
  22:  [ . 1 2 . 1 ]
  23:  [ . 1 2 1 . ]
  24:  [ . 1 2 1 1 ]
  25:  [ . 1 2 2 . ]
  26:  [ . 1 2 2 1 ]
		

Crossrefs

Programs

  • Maple
    b:= proc(i, l) option remember;
          `if`(i<=0, 1, add(b(i-1, j), j=0..min(l+1, i)))
        end:
    a:= n-> b(n-1, 0):
    seq(a(n), n=0..40);  # Alois P. Heinz, Feb 08 2012
  • Mathematica
    b[i_, l_] := b[i, l] = If[i <= 0, 1, Sum[b[i-1, j], {j, 0, Min[l+1, i]}]];
    a[n_] := b[n-1, 0];
    a /@ Range[0, 40] (* Jean-François Alcover, Nov 07 2020, after Alois P. Heinz *)

Formula

Conjecture: a(n) = Sum_{k = 0..floor(n/4)} (-1)^k * C(floor(n/2) + 1 - k, k + 1) * a(n - 1 - k), a(0) = 1. - Gionata Neri, Jun 17 2018

A291683 Number of permutations p of [n] such that in 0p the largest up-jump equals 2 and no down-jump is larger than 2.

Original entry on oeis.org

0, 0, 1, 3, 9, 25, 71, 205, 607, 1833, 5635, 17577, 55515, 177191, 570699, 1852571, 6055079, 19910729, 65823751, 218654099, 729459551, 2443051213, 8210993363, 27685671843, 93625082139, 317470233149, 1079183930827, 3676951654519, 12554734605495, 42952566314235
Offset: 0

Views

Author

Alois P. Heinz, Aug 29 2017

Keywords

Comments

An up-jump j occurs at position i in p if p_{i} > p_{i-1} and j is the index of p_i in the increasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are larger than p_{i-1}. A down-jump j occurs at position i in p if p_{i} < p_{i-1} and j is the index of p_i in the decreasingly sorted list of those elements in {p_{i}, ..., p_{n}} that are smaller than p_{i-1}. First index in the lists is 1 here.
All positive terms are odd.

Examples

			a(2) = 1: 21.
a(3) = 3: 132, 213, 231.
a(4) = 9: 1243, 1324, 1342, 2134, 2143, 2314, 2341, 2413, 2431.
a(5) = 25: 12354, 12435, 12453, 13245, 13254, 13425, 13452, 13524, 13542, 21345, 21354, 21435, 21453, 23145, 23154, 23415, 23451, 23514, 23541, 24135, 24153, 24315, 24351, 24513, 24531.
		

Crossrefs

Column k=2 of A291680.

Programs

  • Maple
    b:= proc(u, o, k) option remember; `if`(u+o=0, 1,
          add(b(u-j, o+j-1, k), j=1..min(2, u))+
          add(b(u+j-1, o-j, k), j=1..min(k, o)))
        end:
    a:= n-> b(0, n, 2)-b(0, n, 1):
    seq(a(n), n=0..30);
  • Mathematica
    b[u_, o_, k_] := b[u, o, k] = If[u + o == 0, 1, Sum[b[u - j, o + j - 1, k], {j, 1, Min[2, u]}] + Sum[b[u + j - 1, o - j, k], {j, 1, Min[k, o]}]];
    a[n_] := b[0, n, 2] - b[0, n, 1];
    Array[a, 30, 0] (* Jean-François Alcover, May 31 2019, from Maple *)
  • Python
    from sympy.core.cache import cacheit
    @cacheit
    def b(u, o, k): return 1 if u + o==0 else sum([b(u - j, o + j - 1, k) for j in range(1, min(2, u) + 1)]) + sum([b(u + j - 1, o - j, k) for j in range(1, min(k, o) + 1)])
    def a(n): return b(0, n, 2) - b(0, n, 1)
    for n in range(31): print (a(n)) # Indranil Ghosh, Aug 30 2017

A320290 Number of permutations p of [2n] such that in 0p the largest up-jump equals n and no down-jump is larger than 2.

Original entry on oeis.org

1, 1, 9, 156, 3098, 69274, 1626122, 39892080, 1004867492, 25886899652, 677767802220, 17984050212906, 482214668573802, 13042214648300918, 355247290177412584, 9733704443846822462, 268026951144933433138, 7411550898419782031320, 205686202884689885529314
Offset: 0

Views

Author

Alois P. Heinz, Oct 27 2018

Keywords

Crossrefs

Cf. A291680.

Programs

  • Maple
    b:= proc(u, o, k) option remember; `if`(u+o=0, 1,
          add(b(u-j, o+j-1, k), j=1..min(2, u))+
          add(b(u+j-1, o-j, k), j=1..min(k, o)))
        end:
    a:= n-> `if`(n=0, 1, b(0, 2*n, n)-b(0, 2*n, n-1)):
    seq(a(n), n=0..20);
  • Mathematica
    b[u_, o_, k_] := b[u, o, k] = If[u + o == 0, 1,
         Sum[b[u - j, o + j - 1, k], {j, 1, Min[2, u]}] +
         Sum[b[u + j - 1, o - j, k], {j, 1, Min[k, o]}]];
    a[n_] := If[n == 0, 1, b[0, 2*n, n] - b[0, 2*n, n - 1]];
    Table[a[n], {n, 0, 20}] (* Jean-François Alcover, Apr 21 2022, after Alois P. Heinz *)

Formula

a(n) = A291680(2n,n).

A321110 Number of permutations p of [n] such that in 0p the largest up-jump equals three and no down-jump is larger than 2.

Original entry on oeis.org

2, 8, 36, 156, 666, 2860, 12336, 53518, 233874, 1029134, 4559664, 20335346, 91254770, 411885192, 1869127696, 8524561158, 39058221662, 179724281242, 830256254372, 3849435933628, 17907743518356, 83566689375980, 391087227771308, 1835146738581226, 8632600618453808
Offset: 3

Views

Author

Alois P. Heinz, Oct 27 2018

Keywords

Crossrefs

Column k=3 of A291680.

Programs

  • Maple
    b:= proc(u, o, k) option remember; `if`(u+o=0, 1,
          add(b(u-j, o+j-1, k), j=1..min(2, u))+
          add(b(u+j-1, o-j, k), j=1..min(k, o)))
        end:
    a:= n-> (k-> b(0, n, k)-b(0, n, k-1))(3):
    seq(a(n), n=3..30);

A321111 Number of permutations p of [n] such that in 0p the largest up-jump equals four and no down-jump is larger than 2.

Original entry on oeis.org

4, 20, 108, 586, 3098, 16230, 85150, 446972, 2349616, 12376800, 65353448, 345933358, 1835637246, 9764363438, 52064375292, 278256581910, 1490475179006, 8000983513636, 43039329754332, 231982689315468, 1252791611642654, 6777998215153164, 36735901427197962
Offset: 4

Views

Author

Alois P. Heinz, Oct 27 2018

Keywords

Crossrefs

Column k=4 of A291680.

Programs

  • Maple
    b:= proc(u, o, k) option remember; `if`(u+o=0, 1,
          add(b(u-j, o+j-1, k), j=1..min(2, u))+
          add(b(u+j-1, o-j, k), j=1..min(k, o)))
        end:
    a:= n-> (k-> b(0, n, k)-b(0, n, k-1))(4):
    seq(a(n), n=4..30);

A321112 Number of permutations p of [n] such that in 0p the largest up-jump equals five and no down-jump is larger than 2.

Original entry on oeis.org

10, 58, 340, 2014, 11888, 69274, 401648, 2329526, 13514794, 78445016, 455726404, 2650463368, 15433424116, 89977250572, 525210971550, 3069436719818, 17959557595206, 105203403819650, 616942677047888, 3621795968081798, 21283870741193560, 125201162038738596
Offset: 5

Views

Author

Alois P. Heinz, Oct 27 2018

Keywords

Crossrefs

Column k=5 of A291680.

Programs

  • Maple
    b:= proc(u, o, k) option remember; `if`(u+o=0, 1,
          add(b(u-j, o+j-1, k), j=1..min(2, u))+
          add(b(u+j-1, o-j, k), j=1..min(k, o)))
        end:
    a:= n-> (k-> b(0, n, k)-b(0, n, k-1))(5):
    seq(a(n), n=5..30);

A321113 Number of permutations p of [n] such that in 0p the largest up-jump equals six and no down-jump is larger than 2.

Original entry on oeis.org

26, 170, 1078, 6772, 42366, 263548, 1626122, 9993996, 61372356, 376754190, 2312742484, 14199997152, 87223775288, 536072840284, 3296748123732, 20287763348424, 124932460269594, 769857062164974, 4747179317544360, 29291823451184116, 180856995405347960
Offset: 6

Views

Author

Alois P. Heinz, Oct 27 2018

Keywords

Crossrefs

Column k=6 of A291680.

Programs

  • Maple
    b:= proc(u, o, k) option remember; `if`(u+o=0, 1,
          add(b(u-j, o+j-1, k), j=1..min(2, u))+
          add(b(u+j-1, o-j, k), j=1..min(k, o)))
        end:
    a:= n-> (k-> b(0, n, k)-b(0, n, k-1))(6):
    seq(a(n), n=6..30);
Showing 1-10 of 14 results. Next