- or download this
#! /usr/bin/perl
use strict;
...
my $div = divisors($a);
print "sorted list of divisors of $N is ",$div,"\n";
}
- or download this
perl ddd.pl 12345
sorted list of divisors of 12345 is [1,3,5,15,823,2469,4115,12345]
- or download this
module Powerset where
...
-}
factor_sqrt n factors =
fsqrt (sqrt n) 0 (powerset factors)
- or download this
Prelude> :l Powerset.hs
Powerset> factor_sqrt 24777695232 [(2,13),(3,8),(461,1)]
149364.0