OFFSET
0,2
COMMENTS
a(0) = 0 by convention.
MAPLE
c:=proc(x, y) local s: s:=proc(m) nops(convert(m, base, 10)) end: if y=0 then 10*x else x*10^s(y)+y: fi end: b:=proc(n) local nn: nn:=convert(n, base, 10): [seq(nn[nops(nn)+1-i], i=1..nops(nn))] end: A:=0: for n from 1 to 500 do A:=c(A, n) od: B:=[0, seq(b(A)[j], j=1..nops(b(A)))]: u:=proc(n) if B[n]=0 then n else fi end: U:=[seq(u(n), n=1..nops(B))]: 0, seq(add(B[j], j=U[i]..U[i+1]), i=1..nops(U)-1); # there must exist a simpler Maple program! - Emeric Deutsch, Jul 27 2006
#alternative
A119385 := proc(n) option remember ; local nupto, a, a007376, k ; if n =0 then RETURN([0, 0]) ; else nupto := op(2, A119385(n-1)) ; a := 0 ; for k from nupto+1 do a007376 := A007376(k) ; if op(1, a007376) > 0 then a := a+op(1, a007376) ; else RETURN([a, k]) ; fi ; od: fi ; end :# R. J. Mathar, Jan 21 2008
MATHEMATICA
list1=Flatten[Table[IntegerDigits[i], {i, 0, 1000}]];
index1=Partition[Flatten[Position[list1, 0]], 2, 1];
Plus@@@Table[Take[list1, Flatten[Take[index1, {i}]]], {i, Length[index1]}] (From Harvey Dale)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, Jul 26 2006
EXTENSIONS
More terms from Emeric Deutsch, Jul 27 2006
STATUS
approved