Commits

Shlomi Fish  committed 1049eb7

Add ImproperImproperTriangle.

A sub_h.

  • Participants
  • Parent commits fd48922

Comments (0)

Files changed (1)

File project-euler/148/Calc.pl

 
 my @stack = ();
 
-my $LIMIT = 1_000_000_000;
+# my $LIMIT = 1_000_000_000;
+my $LIMIT = 100;
+
 while ($power < $LIMIT)
 {
     my $next_power = $power * $B;
                         $num_sub_tris_per_tri * $stack[-1]{tri_sum}
                     )
                     +
-                    $num_right_tris * (($p_1 + ($p_1-$height))*$height/2)
+                    $num_right_tris * (($p_1 + ($power-$height))*$height/2)
                     ;
                 print qq#       ==> ImproperImproperTriangle[1 .. @{[$power * $h + $height]}] = @{[$improper_tri_sum + $added_diff]}\n\n#;