Farey sequence by pooq(hirose)

n=io.read"*n"a=0;b=1;d=n;while a<=b do print(a.."/"..b)a=a*d/b+1;a=a-a%1;b,d=d,n-(n+b)%d end

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

download

return to the top page