%I #9 Jul 20 2019 08:09:43
%S 1,1,3,4,11,16,43,65,173,267,707,1105,2917,4597,12111,19196,50503,
%T 80380,211263,337284,885831,1417582,3720995,5965622,15652239,25130844,
%U 65913927,105954110,277822147,447015744,1171853635,1886996681
%N a(n) = T(n, floor(n/2)), T given by A026670.
%C Also a(n) = T(n,m) + T(n,m+1) + ... + T(n,n), m=[ (n+1)/2 ], T given by A026736.
%H G. C. Greubel, <a href="/A026676/b026676.txt">Table of n, a(n) for n = 0..1000</a>
%t T[n_, k_]:= T[n, k] = If[k==0 || k==n, 1, If[k==n-1, n, If[EvenQ[n] && k==(n-2)/2, T[n-1, k-1] + T[n-2, k-1] + T[n-1, k], T[n-1, k-1] + T[n-1, k]]]]; Table[Sum[T[n, k], {k, Floor[(n+1)/2], n}], {n, 0, 40}] (* _G. C. Greubel_, Jul 19 2019 *)
%o (PARI) T(n, k) = if(k==n || k==0, 1, k==n-1, n, if((n%2)==0 && k==(n-2)/2, T(n-1, k-1) + T(n-2, k-1) + T(n-1, k), T(n-1, k-1) + T(n-1, k) ));
%o vector(20, n, n--; sum(k=(n+1)\2, n, T(n, k)) ) \\ _G. C. Greubel_, Jul 19 2019
%o (Sage)
%o @CachedFunction
%o def T(n, k):
%o if (k==0 or k==n): return 1
%o elif (k==n-1): return n
%o elif (mod(n, 2)==0 and k==(n-2)/2): return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k)
%o else: return T(n-1, k-1) + T(n-1, k)
%o [sum(T(n,k) for k in (floor((n+1)/2)..n)) for n in (0..40)] # _G. C. Greubel_, Jul 19 2019
%o (GAP)
%o T:= function(n, k)
%o if k=0 or k=n then return 1;
%o elif k=n-1 then return n;
%o elif (n mod 2)=0 and k=Int((n-2)/2) then return T(n-1, k-1) + T(n-2, k-1) + T(n-1, k);
%o else return T(n-1, k-1) + T(n-1, k);
%o fi;
%o end;
%o List([0..20], n-> Sum([Int((n+1)/2)..n], k-> T(n, k) )); # _G. C. Greubel_, Jul 19 2019
%Y Cf. A026670, A026736.
%K nonn
%O 0,3
%A _Clark Kimberling_
|