OFFSET
1,1
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..1000
MAPLE
b:= proc(n) option remember; local m; m:= a(n); `if`(n=1, 0, b(n-1)); while m>0 do %+ irem(m, 10, 'm') od; % end: a:= proc(n) option remember; `if`(n=1, 5, a(n-1) +b(n-1)) end: seq(a(n), n=1..50); # Alois P. Heinz, Oct 07 2009
MATHEMATICA
a[0] = a[1] = 5; a[n_] := a[n] = 2*a[n-1]-a[n-2]+Total[IntegerDigits[a[n-1]]]; Table[a[n], {n, 1, 45}] (* Jean-François Alcover, Mar 05 2014 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
N. J. A. Sloane, Oct 07 2009
STATUS
approved