login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A225416 Number of iterations of the map n -> f(n) needed to reach 0 and starting with n, where f(n) is given by the following definition: f(n) = u(n) mod v(n) where u(n) = max (n, reverse(n)) and v(n) = min(n, reverse(n)). 1
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 2, 3, 2, 2, 3, 1, 2, 1, 2, 3, 2, 2, 3, 3, 2, 1, 2, 2, 1, 2, 3, 4, 5, 2, 3, 1, 3, 3, 2, 1, 2, 3, 4, 5, 3, 1, 2, 2, 3, 2, 1, 2, 3, 4, 5, 1, 3, 2, 4, 3, 2, 1, 2, 3, 4, 1, 2, 3, 5, 4, 3, 2, 1, 2, 3, 1, 2, 3, 2, 5, 4, 3 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,13

COMMENTS

The fixed points are in A061917 (either a palindrome or becomes a palindrome if trailing 0's are omitted). The number of iterations needed to reach a fixed point equals a(n) - 1 with n > 0, and 0 for n = 0.

The smallest k such that a(k) = n iterations are {0, 1, 12, 14, 36, 37, 103, 118, 238, 257, 1282, 2165, 2459, 11908, 100673, 113233, 144104, 300768, 1329025,...}, and it seems that 3*log10(k)/n ~ 1 where n tends into infinity.

The Maple program below gives two sequences: the number of iterations of this sequence and the fixed points in increasing order (sequence A061917).

LINKS

Michel Lagneau, Table of n, a(n) for n = 0..10000

EXAMPLE

The trajectory of 37 is  37 -> 36 -> 27 -> 18 -> 9 ->0, so a(37) = 5. The fixed point is 9 = A061917(10).

73 mod 37 = 36, 63 mod 36 = 27, 72 mod 27 = 18, 81 mod 18 = 9 and 9 mod 9 = 0.

MAPLE

lst1:={}:for n from 1 to 494 do:nn:=n:ii:=0:r:=1:lst:={n}:for it from 1 to 20 while(r<>0) do: V:=convert(nn, base, 10): n1:=nops(V):s:=0:for a from n1 by -1  to 1 do:s:=s+V[a]*10^(n1-a): od:m1:=min(nn, s):m2:=max(nn, s):r:=irem(m2, m1): lst:=lst union {r}:nn:=r: od: printf(`%d, `, it-1): lst1:=lst1 union { lst[2]}: od:print(lst1):

CROSSREFS

Cf. A061917.

Sequence in context: A083900 A113517 A278399 * A276862 A295784 A275803

Adjacent sequences:  A225413 A225414 A225415 * A225417 A225418 A225419

KEYWORD

nonn,base

AUTHOR

Michel Lagneau, May 07 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 16 21:10 EDT 2019. Contains 328103 sequences. (Running on oeis4.)