C++ prime counting function implementations