The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A335870 a(n) is the least k > 0 such that T^k(n) = T^(2*k)(n) (where T^k denotes the k-th iterate of A006370, the Collatz map); a(n) = -1 if no such k exists. 1

%I

%S 1,3,3,6,3,3,6,15,3,18,6,12,9,9,15,15,3,12,18,18,6,6,15,15,9,21,9,111,

%T 18,18,18,105,3,24,12,12,21,21,21,33,6,108,6,27,15,15,15,102,9,24,24,

%U 24,9,9,111,111,18,30,18,30,18,18,105,105,6,27,27,27,12

%N a(n) is the least k > 0 such that T^k(n) = T^(2*k)(n) (where T^k denotes the k-th iterate of A006370, the Collatz map); a(n) = -1 if no such k exists.

%C If the Collatz conjecture is true, then a(n) > 0 for all n >= 0.

%H Rémy Sigrist, <a href="/A335870/b335870.txt">Table of n, a(n) for n = 0..10000</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Cycle_detection#Floyd&#39;s_Tortoise_and_Hare">Floyd's Tortoise and Hare</a>

%H <a href="/index/3#3x1">Index entries for sequences related to 3x+1 (or Collatz) problem</a>

%e For n = 3 we have:

%e k T^k(3) T^(2*k)(3)

%e - ------ ----------

%e 1 10 5

%e 2 5 8

%e 3 16 2

%e 4 8 4

%e 5 4 1

%e 6 2 2

%e so a(3) = 6.

%o (PARI) a(n, T=x->if (x%2, 3*x+1, x/2)) = my (x1=n, x2=n); for (k=1, oo, x1=T(x1); x2=T(T(x2)); if (x1==x2, return (k)))

%Y Cf. A006370, A139399.

%K nonn

%O 0,2

%A _Rémy Sigrist_, Jun 28 2020

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.

Last modified May 7 07:37 EDT 2021. Contains 343636 sequences. (Running on oeis4.)