#!/usr/bin/perl -w

my $steps;
for my $n (1..1_000_000){
    print "$n: ";
    $steps = 1;
    while ($n>1){
	$steps++;
	if ($n % 2==0){
	    $n /= 2;
	}else{
	    $n *= 3;
	    $n++;
	}	
    }
    print "$steps\n";
}

exit 1;   # TRUE!!!

__END__
  The simplest complex conjecture.
  Take a positive number.
  If it is even, divide by 2.
  If it is odd, multiply by 3 and add 1.
  Loop.  
  You always end with ... 4,2,1
  


