OFFSET
0,2
FORMULA
a(n) = Sum_{k=0..n} (Sum_{i=k..n} M(i))^2, where the M(n)'s are the Motzkin numbers (A001006).
MATHEMATICA
M[n_]:=If[n==0, 1, Coefficient[(1+x+x^2)^(n+1), x^n]/(n+1)]; Table[Sum[Sum[M[i], {i, k, n}]^2, {k, 0, n}], {n, 0, 40}]
PROG
(Maxima) M(n):=coeff(expand((1+x+x^2)^(n+1)), x^n)/(n+1);
makelist(sum(sum(M(i), i, k, n)^2, k, 0, n), n, 0, 20);
CROSSREFS
KEYWORD
nonn
AUTHOR
Emanuele Munarini, Apr 06 2012
STATUS
approved