'What is wrong with my "Collatz conjecture"?

So, I was just trying to create a loop to run the "3n+1" formula and when I enter a negative number I get stuck in an infinite loop with a remainder of 0 and -1.

Is that correct or is my code missing something?

Here is my code:

    Scanner scan = new Scanner(System.in);
    number = 0;
    method = 0;
int counter= 0;

if(scan.hasNextInt()){
     number = scan.nextInt();
  int original = number;
 while(number!=1){
      method = number%2;
     if(method==0){
    number = number/2;
 }else number = number*3+1;
 counter +=1;
  System.out.println(number);
  System.out.println("the remainder was "+method);
 }


 System.out.println("The original number was "+original);
 System.out.println("it took " + counter+ " times to reach 1.");



}else System.out.println("please enter a number");


Solution 1:[1]

Several loops get formed. Further googling will show you there are 3-4 (google for an exact count) loops formed. And then the rest of the negative numbers should also get back down to $-1$ or in other words "something analogous" to the positive case. So you got stuck in the first loop! LOL

I think it should be considered extended to the group of integers so that there is a hope of immediately applying Group Cohomology techniques instead of Monoid Cohomology techniques (which are less explored).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Abstract Space Crack