OFFSET
1,1
LINKS
E.W. Weisstein, Cylinder Cutting
EXAMPLE
Sum of all 1-digit cake numbers is 1 + 2 + 4 + 8 = 15.
Sum of all 2-digit cake numbers is 15 + 26 + 42 + 64 + 93 = 240.
Sum of all 3-digit cake numbers is 130 + 176 + 232 + 299 + 378 + 470 + 576 + 697 + 834 + 988 = 4780.
MATHEMATICA
digNum[n_] := Length @ IntegerDigits[n]; cake[n_] := (n^3 + 5n + 6)/6; digCount = 0; sum = 0; cumsum = {}; Do[c = cake[n]; If[digNum[c] > digCount, digCount++; AppendTo[cumsum, sum]]; sum += c, {n, 0, 10^6}]; Differences[cumsum] (* Amiram Eldar, Nov 30 2019 *)
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Parthasarathy Nambi, Oct 10 2007
EXTENSIONS
More terms from Amiram Eldar, Nov 30 2019
STATUS
approved