checking prime using trial division