Help for this page

Select Code to Download


  1. or download this
    $n >> 1;
    
  2. or download this
        while ($n != 1) {
            $result += $cache[$n], last
    ...
    
            $n = $new_n;
        }
    
  3. or download this
        while ($n != 1) {
            $result += $cache[$n], last
    ...
    
            $n = $new_n;
        }
    
  4. or download this
        while ($n != 1) {
            $result += $cache[$n], last
    ...
    
            $n = $new_n;
        }
    
  5. or download this
    #!/usr/bin/perl
    use strict;
    ...
    
    @long_seqs = sort { $b->[1] <=> $a->[1]} @long_seqs;
    say "$_->[0]: $_->[1]" for @long_seqs[0..19];
    
  6. or download this
    $ time perl collatz3_a.pl 1e7
    
    ...
    5598635: 595
    8397953: 593
    6298465: 590