fun root(n) = if n>0 then let val x = root(n div 4); in if (2*x+1)*(2*x+1) > n then 2*x else 2*x+1 end else 0; fun isPrime(n,c) = if c<=root(n) then