Nth prime by m.ukai

let rec(!)l=Printf.printf"%d
"(List.nth l(read_int()-3));!l
and(@)n?(i=3)l=n=1& !l;n/i*i=n&n-2@l;i*i>n&n-2@n::l;(@)n~i:(i+2)l;;199999@[]

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

download

return to the top page