//PROBLEM 2 #include #include "is_prime.cpp" #include using namespace std; int main() { double p = 1; int count = 0; cout << "p" << left << " 2^p - 1" << right << endl; while (count < 31) { // if ( is_Prime( (int)floor(( pow((2.0,(double)p)-1) ) )) ) if (is_Prime ( (unsigned)( pow(2.0,p)-1) )) { // cout << p << left << " " << (int)floor(((pow(2.0,(double)p)))) << left << endl; cout << p << left << " " << (pow(2.0,p)-1) << left << endl; count++; } p++; } return 0; }