login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = A027052(n, 2n-8).
2

%I #11 Nov 07 2019 08:28:23

%S 1,1,3,11,37,125,421,1405,4637,15125,48777,155665,492157,1543269,

%T 4804663,14865495,45745953,140118817,427445507,1299383403,3937901525,

%U 11902380845,35891429675,108009437323,324455779889,973119941425

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

%H G. C. Greubel, <a href="/A027064/b027064.txt">Table of n, a(n) for n = 4..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-8), n=4..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-8], {n,4,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-8) for n in (4..30)] # _G. C. Greubel_, Nov 06 2019

%K nonn

%O 4,3

%A _Clark Kimberling_