login
a(n) = T(n, floor(n/2)), T given by A026519.
42

%I #12 Dec 22 2021 07:04:16

%S 1,1,1,2,5,8,16,28,65,111,251,436,1016,1763,4117,7176,16913,29521,

%T 69865,122182,290455,508595,1212905,2126312,5085224,8923136,21389824,

%U 37563930,90226449,158563368,381519416,670893296,1616684241,2844444761

%N a(n) = T(n, floor(n/2)), T given by A026519.

%H G. C. Greubel, <a href="/A026530/b026530.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) = A026519(n, floor(n/2)).

%t T[n_, k_]:= T[n, k]= If[k<0 || k>2*n, 0, If[k==0 || k==2*n, 1, If[k==1 || k==2*n-1, Floor[(n+1)/2], If[EvenQ[n], T[n-1, k-2] + T[n-1, k], T[n-1, k-1] + T[n-1, k-2] + T[n-1, k] ]]]]; (* T = A026519 *)

%t a[n_] := a[n] = Block[{$RecursionLimit = Infinity}, T[n, Floor[n/2]] ];

%t Table[a[n], {n, 0, 40}] (* _G. C. Greubel_, Dec 21 2021 *)

%o (Sage)

%o @CachedFunction

%o def T(n,k): # T = A026519

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

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

%o elif (k==1 or k==2*n-1): return (n+1)//2

%o elif (n%2==0): return T(n-1, k) + T(n-1, k-2)

%o else: return T(n-1, k) + T(n-1, k-1) + T(n-1, k-2)

%o [T(n, n//2) for n in (0..40)] # _G. C. Greubel_, Dec 21 2021

%Y Cf. A026519, A026520, A026521, A026522, A026523, A026524, A026525, A026526, A026527, A026528, A026529, A026531, A026532, A026533, A026534, A027262, A027263, A027264, A027265, A027266.

%K nonn

%O 0,4

%A _Clark Kimberling_