OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
a(n) ~ n * phi^(n-2) / 15, where phi = A001622 = (1+sqrt(5))/2 is the golden ratio. - Vaclav Kotesovec, Jul 19 2019
MATHEMATICA
T[n_, k_]:= T[n, k] = If[k==0 || k==n, 1, 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], {k, 0, Floor[n/2]}], {n, 0, 40}] (* G. C. Greubel, Jul 19 2019 *)
PROG
(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) ));
vector(30, n, n--; sum(k=0, n\2, T(n-k, k))) \\ G. C. Greubel, Jul 19 2019
(Sage)
@CachedFunction
def T(n, k):
if (k==0 or k==n): return 1
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)
else: return T(n-1, k-1) + T(n-1, k)
[sum(T(n-k, k) for k in (0..floor(n/2))) for n in (0..40)] # G. C. Greubel, Jul 19 2019
(GAP)
T:= function(n, k)
if k=0 or k=n then return 1;
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);
else return T(n-1, k-1) + T(n-1, k);
fi;
end;
List([0..20], n-> Sum([0..Int(n/2)], k-> T(n-k, k) )); # G. C. Greubel, Jul 19 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved