login
A026615
Triangle read by rows: T(n,0) = T(n,n) = 1 for n >= 0, T(n,1) = T(n,n-1) = 2*n-1 for n >= 1, T(n,k) = T(n-1,k-1) + T(n-1,k) for 2 <= k <= n-2 and n >= 4.
16
1, 1, 1, 1, 3, 1, 1, 5, 5, 1, 1, 7, 10, 7, 1, 1, 9, 17, 17, 9, 1, 1, 11, 26, 34, 26, 11, 1, 1, 13, 37, 60, 60, 37, 13, 1, 1, 15, 50, 97, 120, 97, 50, 15, 1, 1, 17, 65, 147, 217, 217, 147, 65, 17, 1, 1, 19, 82, 212, 364, 434, 364, 212, 82, 19, 1
OFFSET
0,5
COMMENTS
T(n, k) is the number of paths from (0, 0) to (n-k, 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, j)-to-(i+1, j+1) for i=0, j >= 0 and for j=0, i >= 0.
FORMULA
Sum_{k=0..n} T(n, k) = A026622(n) (row sums).
From G. C. Greubel, Jun 13 2024: (Start)
T(n, n-k) = T(n, k).
T(n, 0) = A000012(n).
T(n, 1) = A005408(n-1), n >= 1.
T(n, 2) = A098749(n), n >= 2.
T(n, 3) = A145066(n-2) - [n=3], n >= 3.
Sum_{k=0..n} (-1)^k*T(n, k) = A176742(n) + [n=2].
Sum_{k=0..n} (-1)^k*T(n-k, k) = b(n-2) + 2*[n=0] + [n=1], where b(n) = (1/6)*(-2*sqrt(3)*sin(Pi*n/3) + 2*sqrt(3)*sin(5*Pi*n/3) + 3*cos(Pi* n/2) + 3*cos(3*Pi*n/2) - 6).
Sum_{k=0..n} k*T(n, k) = n*(7*2^(n-3) - 1) + (1/4)*[n=1]. (End)
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 3, 1;
1, 5, 5, 1;
1, 7, 10, 7, 1;
1, 9, 17, 17, 9, 1;
1, 11, 26, 34, 26, 11, 1;
1, 13, 37, 60, 60, 37, 13, 1;
1, 15, 50, 97, 120, 97, 50, 15, 1;
1, 17, 65, 147, 217, 217, 147, 65, 17, 1;
1, 19, 82, 212, 364, 434, 364, 212, 82, 19, 1;
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0 || k==n, 1, If[k==1 || k==n-1, 2*n-1, T[n-1, k -1] + T[n-1, k]]];
Table[T[n, k], {n, 0, 12}, {k, 0, n}]//Flatten (* G. C. Greubel, Jun 13 2024 *)
PROG
(Magma)
function T(n, k) // T = A026615
if k eq 0 or k eq n then return 1;
elif k eq 1 or k eq n-1 then return 2*n-1;
else return T(n-1, k-1) + T(n-1, k);
end if;
end function;
[T(n, k): k in [0..n], n in [0..12]]; // G. C. Greubel, Jun 13 2024
(SageMath)
def T(n, k): # T = A026615
if k==0 or k==n: return 1
elif k==1 or k==n-1: return 2*n-1
else: return T(n-1, k-1) + T(n-1, k)
flatten([[T(n, k) for k in range(n+1)] for n in range(13)]) # G. C. Greubel, Jun 13 2024
CROSSREFS
KEYWORD
nonn,tabl
EXTENSIONS
Offset corrected by G. C. Greubel, Jun 13 2024
STATUS
approved