primality test in ruby