A couple of small changes will get you down to 142:
($n,$d)=split'/',shift;sub p{print"1/$_[0] "}{use Math::Pari lcm;$u=int$d/$n+1;p$u;$l=lcm$d,$u;$n=$n*$l/$d-$l/$u;$d=$l;p($d),die$/i +f$n==1;redo}
In reply to Re^2: Egyptian fractions (Golf Anyone?)
by liverpole
in thread Egyptian fractions
by jimt
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |