- or download this
$n >> 1;
- or download this
while ($n != 1) {
$result += $cache[$n], last
...
$n = $new_n;
}
- or download this
while ($n != 1) {
$result += $cache[$n], last
...
$n = $new_n;
}
- or download this
while ($n != 1) {
$result += $cache[$n], last
...
$n = $new_n;
}
- 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];
- or download this
$ time perl collatz3_a.pl 1e7
...
5598635: 595
8397953: 593
6298465: 590