Implements prime counting