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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A224254 Full cycle lengths in the Collatz (3x+1) problem when the negative integers are used. 0
2, 2, 2, 2, 5, 2, 5, 2, 5, 5, 2, 2, 5, 5, 2, 2, 18, 5, 5, 5, 2, 2, 18, 5, 5, 5, 2, 2, 2, 18, 18, 5, 5, 18, 5, 2, 5, 18, 2, 2, 18, 5, 2, 18, 18, 5, 5, 2, 5, 18, 5, 2, 2, 2, 2, 18, 5, 2, 2, 18, 18, 18, 2, 5, 2, 5, 18, 18, 5, 5, 2, 2, 2, 5, 5, 18, 2, 2, 2, 2, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

There are other cycles of lengths 2, 5 and 18 if negative integers are used. In Z, it is conjectured that the five values of cycle are 1, 2, 3, 5 and 18 (see A121510).

LINKS

Table of n, a(n) for n=1..81.

Wikipedia, Collatz conjecture

EXAMPLE

a(1) = 2 because the cycle -1 -> -2 -> -1... contains 2 distinct terms;

a(5) = 5 because the cycle -5 -> -14 -> -7->-20 -> -5 ... contains 5 distinct terms;

a(17) = 18 because the cycle -17 -> -50 -> -25->-74 -> -37 -> -110 -> -55->-164 -> -82 -> -41 -> -122->-61 -> -182 -> -91 -> -272->-136 -> -68 -> -34 -> -17... contains 18 distinct terms.

MAPLE

nn:=1000:T:=array(1..nn):

for n from -1 by -1 to -100 do:

      x:=n:lst:={n}:k:=1:

          for j from 1 to nn do:

          T[j]:=0:

          od:

         T[1]:=n:

            for it from 1 to 500 do:

               if irem(x, 2)=0

               then

               x := x/2: lst:=lst union{x} :k:=k+1:T[k]:=x:

              else

              x := 3*x+1:  lst:=lst union{x}: k:=k+1:T[k]:=x :

            fi:

            od:

            d:=nops(lst): z:=T[d]:z1:=3*z+1:ii:=0:

              for i from 1 to d while(ii=0) do:

                if T[i]=z1

                then

                q:=d-i: printf(`%d, `, q+1):ii:=1:

               else

               fi:

               od:

               if ii=0 and T[d+1]=n

               then

               printf(`%d, `, d):

               else

          fi:

     od:

CROSSREFS

Cf. A121510, A224166, A224183.

Sequence in context: A130325 A154097 A221491 * A107604 A080647 A324516

Adjacent sequences:  A224251 A224252 A224253 * A224255 A224256 A224257

KEYWORD

nonn

AUTHOR

Michel Lagneau, Apr 02 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 November 13 12:45 EST 2019. Contains 329094 sequences. (Running on oeis4.)