OFFSET
1,6
COMMENTS
Essentially the same as A023431.
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 666
FORMULA
a(n) = A023431(n-3).
G.f.: (1+x-sqrt(1-2*x+x^2-4*x^3))/2. - Michael Somos, Jun 08 2000
n*a(n) = (2*n-3)*a(n-1) -(n-3)*a(n-2) +2*(2*n-9)*a(n-3). - R. J. Mathar, Feb 25 2015
a(n) = hypergeom([(3 - n)/3, (4 - n)/3, (5 - n)/3], [2, 3 - n], 27) for n >= 3. - Peter Luschny, Jun 15 2022
MAPLE
a := n -> ifelse(n < 3, 0^(n - 1),
hypergeom([(3 - n)/3, (4 - n)/3, (5 - n)/3], [2, -n + 3], 27)):
seq(simplify(a(n)), n = 1..32); # Peter Luschny, Jun 15 2022
MATHEMATICA
a[n_]:= a[n]= If[n<4, 1-Boole[n==2], Sum[a[j]*a[n-j], {j, n-3}]];
Table[a[n], {n, 45}] (* G. C. Greubel, Jun 15 2022 *)
PROG
(PARI) a(n)=polcoeff((1+x-sqrt(1-2*x+x^2-4*x^3+x*O(x^n)))/2, n)
(Magma) [n le 2 select 2-n else (&+[Binomial(n-k-3, 2*k)*Catalan(k): k in [0..Floor((n-3)/3)]]): n in [1..45]]; // G. C. Greubel, Jun 15 2022
(SageMath) [bool(n==1) + sum(binomial(n-k-3, 2*k)*catalan_number(k) for k in (0..((n-3)//3))) for n in (1..45)] # G. C. Greubel, Jun 15 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved