Farey sequence by houmei

{b=c=1;d=$0;print a+0 "/" b;while(c<=$0){k=int(($0+b)/d);C=k*c-a;D=k*d-b;print c "/" d;a=c;b=d;c=C;d=D}}

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

download

return to the top page