faster isprime()
prototype naive implementation for p146