Displaying 1-10 of 10 results found.
page
1
Triangular array T read by rows: T(n,0)=T(n,n)=1 for n >= 0; for n >= 2 and 1 <= k <= n-1, T(n,k) = T(n-1,k-1) + T(n-2,k-1) + T(n-1,k) if 1 <= k <= floor(n/2), else T(n,k) = T(n-1,k-1) + T(n-1,k).
+10
32
1, 1, 1, 1, 3, 1, 1, 5, 4, 1, 1, 7, 12, 5, 1, 1, 9, 24, 17, 6, 1, 1, 11, 40, 53, 23, 7, 1, 1, 13, 60, 117, 76, 30, 8, 1, 1, 15, 84, 217, 246, 106, 38, 9, 1, 1, 17, 112, 361, 580, 352, 144, 47, 10, 1, 1, 19, 144, 557, 1158, 1178, 496, 191, 57, 11, 1
COMMENTS
T(n,k) is the number of paths from (0,0) to (k,n-k) in the directed graph having vertices (i,j) and edges (i,j)-to-(i+1,j) and (i,j)-to-(i,j+1) for i,j>= 0 and edges (i,i+h)-to-(i+1,i+h+1) for i>=0, h>=0.
Also, square array R read by antidiagonals with R(i,j) = T(i+j,i) equal number of paths from (0,0) to (i,j). - Max Alekseyev, Jan 13 2015
FORMULA
For n>=2*k, T(n,k) = coefficient of x^k in F(x)*S(x)^(n-2*k). For n<=2*k, T(n,k) = coefficient of x^(n-k) in F(x)*C(x)^(2*k-n). Here C(x) = (1 - sqrt(1-4x))/(2*x) is o.g.f. for A000108, S(x) = (1 - x - sqrt(1-6*x+x^2))/(2*x) is o.g.f. for A006318, and F(x) = S(x)/(1 - x*C(x)*S(x)) is o.g.f. for A026781. - Max Alekseyev, Jan 13 2015
EXAMPLE
The array T(n,k) starts with:
n=0: 1;
n=1: 1, 1;
n=2: 1, 3, 1;
n=3: 1, 5, 4, 1;
n=4: 1, 7, 12, 5, 1;
n=5: 1, 9, 24, 17, 6, 1;
n=6: 1, 11, 40, 53, 23, 7, 1;
...
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k =n then 1;
elif k <= n/2 then
procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k) ;
else
procname(n-1, k-1)+procname(n-1, k) ;
fi ;
end proc:
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k] ]]];
Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* G. C. Greubel, Nov 01 2019 *)
PROG
(PARI) T(n, k) = if(n<0, 0, if(k==0 || k==n, 1, if( k<=n/2, T(n-1, k-1) + T(n-2, k-1) + T(n-1, k), T(n-1, k-1) + T(n-1, k) )); )
for(n=0, 12, for(k=0, n, print1(T(n, k), ", "))) \\ G. C. Greubel, Oct 31 2019
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (k<=n/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
[[T(n, k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Oct 31 2019
(GAP)
T:= function(n, k)
if n<0 then return 0;
elif k=0 or k=n then return 1;
elif (k <= Int(n/2)) then return T(n-1, k-1)+T(n-2, k-1) +T(n-1, k);
else return T(n-1, k-1) + T(n-1, k);
fi;
end;
Flat(List([0..12], n-> List([0..n], k-> T(n, k) ))); # G. C. Greubel, Oct 31 2019
a(n) = T(2n,n), T given by A026780.
+10
14
1, 3, 12, 53, 246, 1178, 5768, 28731, 145108, 741392, 3825418, 19907156, 104370554, 550816506, 2924018194, 15603778253, 83661779470, 450479003038, 2435009205992, 13208558795146, 71879906857596, 392320357251928, 2147102400154768, 11780181236675858, 64782405317073968, 357022158144941548
COMMENTS
Number of paths from (0,0) to (n,n) in the directed graph having vertices (i,j) and edges (i,j)-to-(i+1,j) and (i,j)-to-(i,j+1) for i,j>=0 and edges (i,i+h)-to-(i+1,i+h+1) for i>=0, h>=0.
FORMULA
O.g.f.: S(x)/(1-x*C(x)*S(x)) = (S(x)-C(x))/(x*C(x)), where C(x)=(1-sqrt(1-4x))/(2*x) is o.g.f. for A000108 and S(x)=(1-x-sqrt(1-6*x+x^2))/(2*x) is o.g.f. for A006318. - Max Alekseyev, Jan 13 2015
D-finite with recurrence 2*n*(132*n-445)*(n+2)*(n+1)*a(n) -n*(n+1) *(5587*n^2 -23082*n +12800)*a(n-1) +2*n*(n-1)*(22870*n^2 -114505*n +116854)*a(n-2) +2*(-90081*n^4 +818062*n^3 -2626791*n^2 +3517598*n -1622544)*a(n-3) +4*(85519*n^4 -1071535*n^3 +4986308*n^2 -10177616*n +7647024)*a(n-4) +(-269235*n^4 +4490125*n^3 -27985152*n^2 +77217236*n -79534224)*a(n-5) +4*(2*n-11)*(8203*n^3 -117312*n^2 +557264*n -879984)*a(n-6) -4*(n-6)*(307*n -1414) *(2*n-11) *(2*n-13)*a(n-7)=0. - R. J. Mathar, Feb 20 2020
MAPLE
seq(coeff(series(2*(1-x -sqrt(1-6*x+x^2))/(4*x -(1 -sqrt(1-4*x))*(1 -x -sqrt(1-6*x+x^2))), x, n+1), x, n), n = 0..30); # G. C. Greubel, Nov 02 2019
MATHEMATICA
CoefficientList[Series[2*(1-x -Sqrt[1-6*x+x^2])/(4*x -(1 -Sqrt[1-4*x])*(1 -x -Sqrt[1-6*x+x^2])), {x, 0, 30}], x] (* G. C. Greubel, Nov 02 2019 *)
PROG
(PARI) C = (1-sqrt(1-4*x+O(x^51)))/2/x; S = (1-x-sqrt(1-6*x+x^2 +O(x^51) ))/2/x; Vec(S/(1-x*C*S)) /* Max Alekseyev, Jan 13 2015 */
(Magma) R<x>:=PowerSeriesRing(Rationals(), 30); Coefficients(R!( 2*(1-x -Sqrt(1-6*x+x^2))/(4*x -(1 -Sqrt(1-4*x))*(1 -x -Sqrt(1-6*x+x^2))) )); // G. C. Greubel, Nov 02 2019
(Sage)
P.<x> = PowerSeriesRing(ZZ, prec)
return P(2*(1-x -sqrt(1-6*x+x^2))/(4*x -(1 -sqrt(1-4*x))*(1 -x -sqrt(1-6*x+x^2)))).list()
a(n) = Sum_{k=0..n} T(n,k), T given by A026780.
+10
12
1, 2, 5, 11, 26, 58, 136, 306, 717, 1625, 3813, 8697, 20451, 46909, 110563, 254855, 602042, 1393746, 3299304, 7666786, 18182976, 42391546, 100704606, 235452416, 560147414, 1312916040, 3127406812, 7346213746, 17518138314, 41228281888, 98408997716, 231990850378, 554207752781, 1308436686305, 3128033585157
FORMULA
O.g.f.: F(x^2)*(1/(1-x*S(x^2))+C(x^2)*x/(1-x*C(x^2))), where C(x)=(1-sqrt(1-4x))/(2*x) is o.g.f. for A000108, S(x)=(1-x-sqrt(1-6*x+x^2))/(2*x) is o.g.f. for A006318, and F(x)=S(x)/(1-x*C(x)*S(x)) is o.g.f. for A026781. - Max Alekseyev, Jan 13 2015
C(x^2)/(1-x*C(x^2)) above is the o.g.f. for A001405. 1/(1-x*S(x^2)) above is the o.g.f for A026003 starting with an additional 1: 1,1,1,3,5,13,25,... - R. J. Mathar, Feb 10 2022
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k =n then 1;
elif k <= n/2 then
procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k) ;
else
procname(n-1, k-1)+procname(n-1, k) ;
fi ;
end proc:
seq( add(T(n, k), k=0..n), n=0..30); # G. C. Greubel, Nov 02 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k] ]]];
Table[Sum[T[n, k], {k, 0, n}], {n, 0, 30}] (* G. C. Greubel, Nov 02 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (k<=n/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
[sum(T(n, k) for k in (0..n)) for n in (0..30)] # G. C. Greubel, Nov 02 2019
a(n) = T(2n,n-1), T given by A026780.
+10
11
1, 7, 40, 217, 1158, 6150, 32656, 173719, 926664, 4958556, 26619438, 143365880, 774562478, 4197344582, 22810572062, 124300860689, 679081142350, 3718894341450, 20412141531664, 112276061739814, 618806031336236, 3416954495002676
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k =n then 1;
elif k <= n/2 then
procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k) ;
else
procname(n-1, k-1)+procname(n-1, k) ;
fi ;
end proc:
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k] ]]];
PROG
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (k<=n/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
a(n) = T(2n, n-2), T given by A026780.
+10
11
1, 11, 84, 557, 3446, 20514, 119336, 684227, 3886460, 21939528, 123347842, 691644044, 3871738018, 21652138770, 121026492186, 676391629701, 3780636102222, 21137831159462, 118234019051048, 661686074145618, 3705252204960252
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k =n then 1;
elif k <= n/2 then
procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k) ;
else
procname(n-1, k-1)+procname(n-1, k) ;
fi ;
end proc:
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k] ]]];
PROG
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (k<=n/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
a(n) = T(2n-1, n-1), T given by A026780.
+10
11
1, 5, 24, 117, 580, 2916, 14834, 76221, 395048, 2063104, 10847078, 57373672, 305110106, 1630489090, 8751851866, 47166202181, 255128842340, 1384688987728, 7538592535170, 41159292861980, 225315261459390, 1236441650047554
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k =n then 1;
elif k <= n/2 then
procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k) ;
else
procname(n-1, k-1)+procname(n-1, k) ;
fi ;
end proc:
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k] ]]];
PROG
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (k<=n/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
a(n) = T(2n-1, n-2), T given by A026780.
+10
11
1, 9, 60, 361, 2076, 11672, 64842, 357897, 1968788, 10813804, 59372770, 326086492, 1792293014, 9861375614, 54324086446, 299651439321, 1655124211372, 9154654655044, 50704627346170, 281214708137032, 1561706813618886
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k =n then 1;
elif k <= n/2 then
procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k) ;
else
procname(n-1, k-1)+procname(n-1, k) ;
fi ;
end proc:
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k] ]]];
Table[T[2*n-1, n-2], {n, 2, 30}] (* G. C. Greubel, Nov 02 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (k<=n/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
a(n) = T(n, floor(n/2)), T given by A026780.
+10
11
1, 1, 3, 5, 12, 24, 53, 117, 246, 580, 1178, 2916, 5768, 14834, 28731, 76221, 145108, 395048, 741392, 2063104, 3825418, 10847078, 19907156, 57373672, 104370554, 305110106, 550816506, 1630489090, 2924018194, 8751851866
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k =n then 1;
elif k <= n/2 then
procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k) ;
else
procname(n-1, k-1)+procname(n-1, k) ;
fi ;
end proc:
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k] ]]];
Table[T[n, Floor[n/2]], {n, 0, 30}] (* G. C. Greubel, Nov 02 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (k<=n/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
a(n) = Sum_{i=0..n} Sum_{j=0..n} T(i,j), T given by A026780.
+10
11
1, 3, 8, 19, 45, 103, 239, 545, 1262, 2887, 6700, 15397, 35848, 82757, 193320, 448175, 1050217, 2443963, 5743267, 13410053, 31593029, 73984575, 174689181, 410141597, 970289011, 2283205051, 5410611863, 12756825609, 30274963923
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k =n then 1;
elif k <= n/2 then
procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k) ;
else
procname(n-1, k-1)+procname(n-1, k) ;
fi ;
end proc:
seq( add(add(T(j, k), k=0..n), j=0..n), n=0..30); # G. C. Greubel, Nov 02 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k] ]]];
Table[Sum[T[j, k], {k, 0, n}, {j, 0, n}], {n, 0, 30}] (* G. C. Greubel, Nov 02 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (k<=n/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
[sum( sum( T(j, k) for k in (0..n)) for j in (0..n)) for n in (0..30)] # G. C. Greubel, Nov 02 2019
a(n) = Sum_{k=0..floor(n/2)} T(n-k,k), T given by A026780.
+10
11
1, 1, 2, 4, 7, 12, 23, 41, 72, 135, 243, 432, 804, 1455, 2608, 4836, 8785, 15838, 29306, 53385, 96654, 178600, 326019, 592140, 1093135, 1998537, 3638700, 6712659, 12287071, 22412784, 41325279, 75712253, 138308808, 254912873
MAPLE
T:= proc(n, k) option remember;
if n<0 then 0;
elif k=0 or k =n then 1;
elif k <= n/2 then
procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k) ;
else
procname(n-1, k-1)+procname(n-1, k) ;
fi ;
end proc:
seq( add(T(n-k, k), k=0..floor(n/2)), n=0..40); # G. C. Greubel, Nov 02 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[k<=n/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k] ]]];
Table[Sum[T[n-k, k], {k, 0, Floor[n/2]}], {n, 0, 40}] (* G. C. Greubel, Nov 02 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (k<=n/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
else: return T(n-1, k-1) + T(n-1, k)
[sum(T(n-k, k) for k in (0..floor(n/2))) for n in (0..40)] # G. C. Greubel, Nov 02 2019
Search completed in 0.009 seconds
|