Farey sequence by nn

m=1,n,i;main(g){for(gets(&n);i%g+m%g?g--:(m/g>n%48||printf("%d/%d\n",i/g,m/g),g=m=840)/++i;);}

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

download

return to the top page