(* Consider the fraction, n/d, where n and d are positive integers. If n= y ) then (count 1 (y-1) n) else if( y >= 3*x ) then (count (x+1) y n) else count (x+1) y (if (gcd x y > 1) then n else (n+1)) in count 1 10000 0 ;; Printf.printf "%d\n" count;;