OFFSET
1,1
EXAMPLE
Sum of all 1-digit Stern numbers is 1 + 1 + 2 + 3 + 6 = 13.
Sum of all 2-digit Stern numbers is 11 + 20 + 40 + 77 = 148.
Sum of all 3-digit Stern numbers is 148 + 285 + 570 = 1003.
MATHEMATICA
stern[1] = 1; stern[n_] := stern[n] = Sum[stern[k], {k, n - Ceiling[(Sqrt[8*n -7]-1)/2], n-1}]; digNum[n_] := Length @ IntegerDigits[n]; digCount = 0; sum = 0; cumsum = {}; Do[s = stern[n]; If[digNum[s] > digCount, digCount++; AppendTo[cumsum, sum]]; sum += s, {n, 1, 25}]; Differences[cumsum] (* Amiram Eldar, Nov 30 2019 *)
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Parthasarathy Nambi, Nov 01 2007
EXTENSIONS
More terms from Amiram Eldar, Nov 30 2019
STATUS
approved