Egyptian fraction by twobit

while""do
a="*n"x,s,y=io.read(a,1,a)b=x..s..y.." ="while x>0 do
q=x x=-y%x w=(y+x)/q y=y*w a=a.." + 1/"..w
end
print(b..a:sub(5))end

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

download

return to the top page