modular prime counting function