login
A027060
a(n) = T(n,2n-4), T given by A027052.
2
1, 1, 3, 11, 35, 107, 319, 935, 2713, 7825, 22491, 64523, 184945, 530001, 1519151, 4356471, 12501301, 35901325, 103188123, 296844379, 854701935, 2463133311, 7104685935, 20510632575, 59262772629, 171373598341, 495968905267
OFFSET
2,3
LINKS
MAPLE
T:= proc(n, k) option remember;
if k<0 or k>2*n then 0
elif k=0 or k=2 or k=2*n then 1
elif k=1 then 0
else add(T(n-1, k-j), j=1..3)
fi
end:
seq( T(n, 2*n-4), n=2..30); # G. C. Greubel, Nov 06 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k<0 || k>2*n, 0, If[k==0 || k==2 || k==2*n, 1, If[k==1, 0, Sum[T[n-1, k-j], {j, 3}]]]]; Table[T[n, 2*n-4], {n, 2, 30}] (* G. C. Greubel, Nov 06 2019 *)
PROG
(Sage)
@CachedFunction
def T(n, k):
if (k<0 or k>2*n): return 0
elif (k==0 or k==2 or k==2*n): return 1
elif (k==1): return 0
else: return sum(T(n-1, k-j) for j in (1..3))
[T(n, 2*n-4) for n in (2..30)] # G. C. Greubel, Nov 06 2019
CROSSREFS
Sequence in context: A223626 A088578 A320683 * A171498 A126939 A370199
KEYWORD
nonn
STATUS
approved