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
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.
-
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
-
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 *)
-
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
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
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 ;
Cf.
A000295,
A001720,
A005165,
A008292,
A081285,
A153229,
A291680,
A291684,
A291722,
A316292,
A316293,
A321316.
-
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);
-
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 *)
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
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)
- Mathematics of Evolution and Phylogeny, O. Gascuel (ed.), Oxford University Press, 2005
- Alois P. Heinz, Table of n, a(n) for n = 1..1000
- O. Gascuel, M. Hendy, A. Jean-Marie and R. McLachlan, The combinatorics of tandem duplication trees, Systematic Biology 52, (2003), 110-118.
- J. Yang and L. Zhang, Letter. On Counting Tandem Duplication Trees, Molecular Biology and Evolution, Volume 21, Issue 6, (2004) 1160-1163.
-
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);
-
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 *)
-
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
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
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 ]
-
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
-
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 *)
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
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.
-
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);
-
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 *)
-
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
-
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);
-
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 *)
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
-
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
-
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
-
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
-
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.
Comments