login
A131692
Sum of all n-digit Motzkin numbers.
0
17, 72, 1285, 7986, 57346, 1277673, 8893161, 69051303, 543310782, 13365890713, 98677591278, 801766063038, 6557147147602, 53936034122790, 1399387730108461, 10689672477266256, 89312948959952446, 748842727830680421, 6298761061668331791, 53135898490140592293
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
Cf. A001006.
Sequence in context: A087514 A119625 A130748 * A157864 A229496 A268544
KEYWORD
nonn,base,less
AUTHOR
Parthasarathy Nambi, Sep 15 2007
EXTENSIONS
More terms from Amiram Eldar, Nov 30 2019
STATUS
approved