Commits

Shlomi Fish committed 2dc26e4

Add the lcm which does not work

  • Participants
  • Parent commits 0bb65f9

Comments (0)

Files changed (1)

File project-euler/466/euler-466-v2.pl

             {
                 my $maj_checkpoint = min($MAJ * $maj_factor, $end_prod);
 
+                # $lcm can be 0 if the list is empty.
+                # my $lcm = Math::BigInt::blcm($maj_factor .. $row_idx-1) || 1;
+
                 while ($prod <= $maj_checkpoint)
                 {
                     if (
                         (none { $prod % $_ == 0 } $maj_factor .. $row_idx-1)
+                        # Math::BigInt::bgcd($prod % $lcm, $lcm) == 1
+                        # Math::BigInt::bgcd($prod % $lcm, $lcm) < $maj_factor
                     )
                     {
                         $found_in_next[$next_row][$row_idx]++;