login
Let x(1)x(2)...x(q) denote the decimal expansion of a number n > 9. a(n) is the number of iterations needed to reach the end of the cycle under the map n -> f(n) where f(n) is represented by the number y(1)y(2)...y(q) such that y(k) = (x(k) + x(k+1)) mod 10 for k = 1..q-1 and y(q) = (x(q) + x(1)) mod 10.
1

%I #13 Sep 13 2017 02:19:56

%S 5,4,5,4,2,4,5,4,5,1,4,5,3,2,4,5,4,5,1,5,5,4,2,4,5,4,5,1,5,4,4,2,4,5,

%T 3,5,1,5,4,5,2,4,5,4,5,1,5,4,5,4,4,5,4,5,1,5,3,5,4,2,5,4,5,1,5,4,5,4,

%U 2,4,4,5,1,5,4,5,4,2,3,5,5,1,5,4,5,4,2

%N Let x(1)x(2)...x(q) denote the decimal expansion of a number n > 9. a(n) is the number of iterations needed to reach the end of the cycle under the map n -> f(n) where f(n) is represented by the number y(1)y(2)...y(q) such that y(k) = (x(k) + x(k+1)) mod 10 for k = 1..q-1 and y(q) = (x(q) + x(1)) mod 10.

%C The smallest integers such that the number of iterations equals 1, 2, 3, ... are 19, 14, 22, 11, 10, 104, 106, 110, 119, 108, 112, 101, 100, 114, 121, 502, 1041, 1402, 10110, 10048, 10010, 10202, 10113, 10116, 10118, 10026, 11294, 10281, 10282, 10120, ...

%H Michel Lagneau, <a href="/A237577/b237577.txt">Table of n, a(n) for n = 10..10000</a>

%e a(10) = 5 because 10 -> 11 -> 22 -> 44 -> 88 -> 66 with 5 iterations where 66 is the last number of the cycle because 66 -> 22, which has already appeared in the trajectory.

%e a(327) = 9 because 327 -> 590 -> 495 -> 349 -> 732 -> 59 -> 44 -> 88 -> 66 -> 22 with 9 iterations where 22 is the last number of the cycle because 22 -> 44, which has already appeared in the trajectory.

%p with(numtheory):nn:=100:for n from 10 to 200 do:lst:={n}:nn:=n:s:=1:for it from 1 to 40 while (s<>0)do: x:=convert(nn,base,10):n1:=nops(x):s:=sum('irem(x[i]+x[i+1],10)*10^i', 'i'=1..n1-1):s:=s+irem(x[n1]+x[1],10):lst:=lst union {s}:nn:=s:od:n2:=nops(lst)-1: printf(`%d, `,n2):od:

%K nonn,base

%O 10,1

%A _Michel Lagneau_, Feb 09 2014

%E Name edited by _Jon E. Schoenfield_, Sep 12 2017