OFFSET
0,3
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
MAPLE
P:=proc(n) local i, k, w; for i from 1 by 1 to n do w:=0; k:=i; while k>0 do w:=w+k-trunc(k/10)*10; k:=trunc(k/10); od; print(i mod (w+1)); od; end: P(1000);
PROG
(PARI) a(n) = n % (1+sumdigits(n)); \\ Michel Marcus, Jun 04 2014
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
Olivier Bouaziz (olivier.bouaziz(AT)arcelormittal.com), Jul 29 2008
EXTENSIONS
More terms from Michel Marcus, Jun 04 2014
STATUS
approved