OFFSET

0,2

LINKS

Robert Israel, Table of n, a(n) for n = 0..10000

MAPLE

A[0]:= 0: Agenda:= [0];

for n from 1 to 100 do

t:= Agenda[1] + 3;

if t <= 9 then Agenda:= [op(Agenda[2..-1]), t]

else Agenda:= [op(Agenda[2..-1]), 1, t-10]

fi;

A[n]:= t;

od:

seq(A[i], i=0..100); # Robert Israel, Dec 14 2017

MATHEMATICA

Flatten[ NestList[ Function[x, Flatten[ IntegerDigits[x] + 3]], {0}, 17]]

CROSSREFS

KEYWORD

base,nonn

AUTHOR

Robert G. Wilson v, Feb 12 2005

STATUS

approved