fermat test for prime numbters in ruby