OFFSET
0,3
LINKS
Seiichi Manyama, Table of n, a(n) for n = 0..10000
FORMULA
EXAMPLE
!5 = 0!+1!+2!+3!+4! = 1+1+2+6+24 = 34 --> 3+4=7.
MAPLE
P:=proc(n) local a, i, k, w; a:=0; for i from 1 by 1 to n do w:=0; k:=(i-1)!+a; a:=k; while k>0 do w:=w+k-(trunc(k/10)*10); k:=trunc(k/10); od; print(w); od; end: P(100);
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Paolo P. Lava and Giorgio Balzarotti, Apr 17 2007
STATUS
approved