use ZZ(base) in isprime