OFFSET
1,1
LINKS
Eric Weisstein's World of Mathematics, Motzkin Number
EXAMPLE
Sum of all 1-digit Motzkin numbers is 1 + 1 + 2 + 4 + 9 = 17.
Sum of all 2-digit Motzkin numbers is 21 + 52 = 72.
Sum of all 3-digit Motzkin numbers is 127 + 323 + 835 = 1285.
MATHEMATICA
digNum[n_] := Length @ IntegerDigits[n]; mot[0] = 1; mot[n_] := mot[n] = mot[n - 1] + Sum[mot[k] * mot[n - 2 - k], {k, 0, n - 2}]; digCount = 0; sum = 0; cumsum = {}; Do[m = mot[n]; If[digNum[m] > digCount, digCount++; AppendTo[cumsum, sum]]; sum += m, {n, 0, 50}]; Differences[cumsum] (* Amiram Eldar, Nov 30 2019 *)
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Parthasarathy Nambi, Sep 15 2007
EXTENSIONS
More terms from Amiram Eldar, Nov 30 2019
STATUS
approved