A103695 Add 3 to each of the preceding digits, beginning with 0.
0, 3, 6, 9, 12, 4, 5, 7, 8, 10, 11, 4, 3, 4, 4, 7, 6, 7, 7, 10, 9, 10, 10, 4, 3, 12, 4, 3, 4, 3, 7, 6, 4, 5, 7, 6, 7, 6, 10, 9, 7, 8, 10, 9, 10, 9, 4, 3, 12, 10, 11, 4, 3, 12, 4, 3, 12, 7, 6, 4, 5, 4, 3, 4, 4, 7, 6, 4, 5, 7, 6, 4, 5, 10, 9, 7, 8, 7, 6, 7, 7, 10, 9, 7, 8, 10, 9, 7, 8, 4, 3, 12, 10, 11, 10
Offset: 0
Links
- Robert Israel, Table of n, a(n) for n = 0..10000
Programs
-
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]]