login
A026681
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-1,k) if k or n-k is of form 2h for h=1,2,...,[ n/4 ], else T(n,k)=T(n-1,k-1)+T(n-2,k-1)+T(n-1,k).
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, 44, 26, 11, 1, 1, 13, 37, 87, 87, 37, 13, 1, 1, 15, 50, 150, 174, 150, 50, 15, 1, 1, 17, 65, 237, 324, 324, 237, 65, 17, 1, 1, 19, 82, 352, 561, 822, 561, 352, 82, 19, 1
OFFSET
1,5
LINKS
FORMULA
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 even and j >= i and for j even and i >= j.
MAPLE
T:= proc(n, k) option remember;
if k=0 or k=n then return 1 fi;
if min(k, n-k)::even then procname(n-1, k-1)+procname(n-1, k)
else procname(n-1, k-1)+procname(n-2, k-1)+procname(n-1, k)
fi
end proc:
seq(seq(T(n, k), k=0..n), n=0..15); # Robert Israel, Jul 16 2019
MATHEMATICA
T[n_, k_] := T[n, k] = With[{}, If[k == 0 || k == n, Return[1]]; If[EvenQ[ Min[k, n-k]], T[n-1, k-1] + T[n-1, k], T[n-1, k-1] + T[n-2, k-1] + T[n-1, k]]];
Table[T[n, k], {n, 0, 15}, {k, 0, n}] // Flatten (* Jean-François Alcover, Jun 04 2020, after Maple *)
CROSSREFS
Sequence in context: A208328 A134398 A026615 * A109128 A113245 A103450
KEYWORD
nonn,tabl
STATUS
approved