OFFSET
0,5
FORMULA
For n >= 2, a(n) = Sum_{m=0..floor((n-1)/3)} binomial(2*m,m+1) * binomial(n-1-2*m,m) + binomial(2*m+1,m) * binomial(n-2-2*m,m).
For n >= 4, a(n) = ( (n-2)*(2*n-1)*(n^2-n-4)*a(n-1) - (n^2-5*n+2)*(n^2+n-4)*a(n-2) + 2*(n-3)*n^2*(2*n-3)*a(n-3) - 4*(n-3)*(n-1)^2*n*a(n-4) ) / (n-2)^2 / (n-1) / (n+2).
G.f. ((1-x^2-2*x^3)*(1-2*x+x^2-4*x^3+4*x^4)^(-1/2) - 1 - x)/x^2/2, which can be expressed in terms of g.f. C(x) = (1-sqrt(1-4*x))/x/2 for Catalan number (A000108) as x*((x+1)*C(x^3/(1-x))-1)/(1-x-2*x^3*C(x^3/(1-x))).
PROG
(PARI) { a370048(n) = (n > 1) * sum(m=0, (n-1)\3, binomial(2*m, m+1) * binomial(n-1-2*m, m) + binomial(2*m+1, m) * binomial(n-2-2*m, m) ); }
(Python)
from math import comb
def A370048(n): return 0 if n<2 else 1+sum((x:=comb((k:=m<<1), m+1)*comb(n-1-k, m))+x*(k+1)*(n-1-3*m)//(m*(n-1-k)) for m in range(1, (n+2)//3)) # Chai Wah Wu, May 01 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Max Alekseyev, Apr 30 2024
STATUS
approved