OFFSET
10,1
COMMENTS
Let the recurrence X(k+1) = X(k) + Y(k) with the initial values : X(0) = n, and {x(1), x(2),...,x(p) } is the decimal expansion of n ; Y(0) has the decimal expansion {y(2), y(3),...,y(p)} where y(i) = abs(x(i)- x(i-1)), i = 2,..., p. For n > = 10, a(n) is the number of iterations of Y(k) needed to reach 0.
According to the computations with the Maple program for big numbers, the recurrence converges. Y(k) tends towards zero after a number of finite iterations, and X(k) tends towards a number q with the decimal expansion {p,p, ...,p }.
LINKS
Michel Lagneau, Table of n, a(n) for n = 10..10000
EXAMPLE
a(11) = 1 because 11 + (1-1) = 11 + 0, and 0 is obtained after the first iteration.
a(12) = 7 because 12 + 1 = 13 -> 13 + 2 = 15 -> 15 + 4= 19 -> 19 + 8 = 27-> 27 + 5 = 32 -> 32 + 1 = 33 -> 33 + 0 = 33 is the last number of the cycle, and 0 is obtained after the 7th iteration.
MAPLE
for n from 10 to 200 do:n0:=n:s:=1:for i from 1 to 10^6 while(s<>0) do:x:=convert(n0, base, 10):n1:=nops(x):s:=sum(abs(x[j+1]-x[j]), j=1..n1-1):n0:=n0+s:it:=i:od: printf(`%d, `, it):od:
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Lagneau, May 18 2010
STATUS
approved