login
a(n) = A027052(n, 2n-5).
2

%I #11 Nov 06 2019 04:27:28

%S 0,2,6,20,66,210,652,1988,5982,17830,52782,155480,456364,1336066,

%T 3904280,11394244,33222902,96812174,282009512,821327088,2391918708,

%U 6966267782,20291422370,59116724728,172271893036,502157965938

%N a(n) = A027052(n, 2n-5).

%H G. C. Greubel, <a href="/A027061/b027061.txt">Table of n, a(n) for n = 3..750</a>

%p T:= proc(n, k) option remember;

%p if k<0 or k>2*n then 0

%p elif k=0 or k=2 or k=2*n then 1

%p elif k=1 then 0

%p else add(T(n-1, k-j), j=1..3)

%p fi

%p end:

%p seq( T(n,2*n-5), n=3..30); # _G. C. Greubel_, Nov 06 2019

%t 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-5], {n,3,30}] (* _G. C. Greubel_, Nov 06 2019 *)

%o (Sage)

%o @CachedFunction

%o def T(n, k):

%o if (k<0 or k>2*n): return 0

%o elif (k==0 or k==2 or k==2*n): return 1

%o elif (k==1): return 0

%o else: return sum(T(n-1, k-j) for j in (1..3))

%o [T(n,2*n-5) for n in (3..30)] # _G. C. Greubel_, Nov 06 2019

%K nonn

%O 3,2

%A _Clark Kimberling_