Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Egyptian fractions (Golf Anyone?)

by blokhead (Monsignor)
on Aug 25, 2006 at 16:43 UTC ( [id://569623]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -e '($n,$d)=split"/",pop;{1while++$x<$d/$n;warn"1/$x\n";$n=$n*$
    +x-$d;$d*=$x;redo if$n}' 18/20
    1/2
    1/3
    1/15
    
  2. or download this
    for(($n,$d)=split"/",pop;$n;){1while++$x<$d/$n;warn"1/$x\n";$n=$n*$x-$
    +d;$d*=$x}
    
  3. or download this
    perl -e '$f=eval pop;{1while++$x<1/$f;warn"1/$x\n";redo if$f-=1/$x}' 1
    +9/20
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-18 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found