All pastes #913589 Raw Edit

Stuff

public text v1 · immutable
·published 2008-02-22 04:57 UTC
rendered paste body
//PROBLEM 2
#include <iostream>
#include "is_prime.cpp"
#include <math.h>
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;
}