Egyptian fraction by pooq

while""do
a,s,b=io.read("*n",1,"*n")d=" ="x=a..s..b
while(a>0)do c=math.ceil(b/a)a=c*a-b
b=c*b
x=x..d.." 1/"..c
d=" +"end
print(x)end

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page