OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = floor(A026633(n)/2) if (n mod 2) = 1 and a(n) = floor((2*A026633(n) + (1+(-1)^n)*A026627(floor(n/2)+1))/4) if (n mod 2) = 0. - G. C. Greubel, Jun 21 2024
MATHEMATICA
T[n_, k_]:= T[n, k]= If[k==0 || k==n, 1, If[k==1 || k==n-1, (6*n-1 + (-1)^n)/4, T[n-1, k-1] +T[n-1, k]]];
A026634[n_]:= Sum[T[n, k], {k, 0, n}];
Table[A026634[n], {n, 0, 40}] (* G. C. Greubel, Jun 21 2024 *)
PROG
(Magma)
b:= func< n | n le 2 select 2*n-1 else ((357*n^3-2696*n^2+6441*n-4822)*Self(n-1) +2*(2*n-7)*(51*n^2-203*n+188)*Self(n-2))/(2*(n-1)*(51*n^2-305*n+442)) >;
A026627:= [b(n+1) : n in [0..60]];
A026633:= [n le 1 select n+1 else (17*2^(n-2) +(-1)^n)/3 -1: n in [0..60]];
function A026634(n)
if (n mod 2) eq 1 then return Floor(A026633[n+1]/2);
end if;
end function;
[A026634(n): n in [0..60]]; // G. C. Greubel, Jun 21 2024
(SageMath)
@CachedFunction
def T(n, k): # T = A026626
if (k==0 or k==n): return 1
elif (k==1 or k==n-1): return int(3*n//2)
else: return T(n-1, k-1) + T(n-1, k)
def A026634(n): return sum(T(n, k) for k in range((n//2)+1))
[A026634(n) for n in range(41)] # G. C. Greubel, Jun 21 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved