OFFSET
0,3
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
FORMULA
a(n + 20) = 200 + a(n) for n > 17. - David A. Corneth, May 11 2018
EXAMPLE
96 + (9 + 6) = 111;
111 + (1 + 1) = 113;
113 + (1 + 3) = 117.
MATHEMATICA
Join[{0, 1, 2, 5}, NestList[#+Total[Take[IntegerDigits[#], -2]]&, 12, 60]] (* Harvey P. Dale, May 11 2018 *)
PROG
(PARI) first(n) = {n = max(n, 5); res = [0, 1, 2, 5, 12]; res = concat(res, vector(n - 5)); for(i = 6, min(n, 37), res[i] = res[i-1] + vecsum(digits(res[i-1] % 100)));
for(i = 38, n, res[i] = res[i - 20] + 200); res} \\ David A. Corneth, May 11 2018
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Eric Angelini, Feb 06 2005
EXTENSIONS
Corrected and extended by Harvey P. Dale, May 11 2018
STATUS
approved