Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Generating powerset with progressive ordering

by tall_man (Parson)
on Feb 25, 2005 at 18:47 UTC ( #434602=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://434602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2015-07-31 07:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (275 votes), past polls