Help for this page

Select Code to Download


  1. or download this
    @num = (2, 4, 5, 7); 
    use List::Util "reduce"; 
    ...
    $asum = reduce { $b - $a } reverse @num; 
    $coeff = do { my @y = @num; while (1 < @y) { $y[$_] -= $y[$_ + 1] for 
    +0 .. @y - 2; splice @y, -1; } $y[0] }; 
    print "lisp difference: $lsub\nalternating sum: $asum\nhighest coeff: 
    +$coeff\n";
    
  2. or download this
    lisp difference: -14
    alternating sum: -4
    highest coeff: -2