login
A026735
a(n) = Sum_{k=0..floor(n/2)} T(n-k,k), T given by A026725.
1
1, 1, 2, 3, 6, 9, 15, 28, 43, 71, 130, 201, 331, 597, 928, 1525, 2720, 4245, 6965, 12315, 19280, 31595, 55472, 87067, 142539, 248802, 391341, 640143, 1111864, 1752007, 2863871, 4953162, 7817033, 12770195, 22004810, 34775005, 56779815
OFFSET
0,3
LINKS
FORMULA
Conjecture: G.f.:-1/2*(2*x^6-5*x^4+8*x^3+x-2+x*(x-1)*(x^2+x+1)*(1-4*x^3)^(1/2))/(x^6+4*x^3-1)/(x^2+x-1). - Maksym Voznyy (voznyy(AT)mail.ru), Aug 11 2009
MAPLE
A026725:= proc(n, k) option remember;
if n<0 or k<0 then 0;
elif k=0 or k=n then 1;
elif 2*k = n-1 then procname(n-1, k-1)+procname(n-2, k-1) + procname(n-1, k) ;
else procname(n-1, k-1)+procname(n-1, k) ;
fi;
end proc:
seq(add(A026725(n-k, k), k=0..floor(n/2)), n=0..30); # G. C. Greubel, Oct 26 2019
MATHEMATICA
T[n_, k_]:= T[n, k]= If[n<0, 0, If[k==0 || k==n, 1, If[OddQ[n] && k==(n-1)/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, 30}] (* G. C. Greubel, Oct 26 2019 *)
PROG
(PARI) T(n, k) = if(n<0, 0, if(k==n || k==0, 1, if(2*k==n-1, T(n-1, k-1) + T(n-2, k-1) + T(n-1, k), T(n-1, k-1) + T(n-1, k) )));
vector(31, n, sum(j=0, (n-1)\2, T(n-j, j)) ) \\ G. C. Greubel, Oct 26 2019
(Sage)
@CachedFunction
def T(n, k):
if (n<0): return 0
elif (k==0 or k==n): return 1
elif (mod(n, 2)==0 and k==(n-1)/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-j, j) for j in (0..floor(n/2))) for n in (0..30)] # G. C. Greubel, Oct 26 2019
(GAP)
T:= function(n, k)
if n<0 then return 0;
elif k=0 or k=n then return 1;
elif 2*k=n-1 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..30], n-> Sum([0..Int(n/2)], k-> T(n-k, k) )); # G. C. Greubel, Oct 26 2019
CROSSREFS
Sequence in context: A293631 A018158 A057928 * A006868 A067435 A035494
KEYWORD
nonn
STATUS
approved