// ---------------------------------------------------------------------- // // Sample ln3 Program // // Module: bad_primes.cc // Description: find prime P such that P-1 is smooth // Date: 2002 // Contributed by: Rene Peralta // // ---------------------------------------------------------------------- #include #include int main( int argc, char *argv[ ] ) { ln p, p_1; p_1 = 2; for (int i = 0; i < 10; i++) p_1 = p_1*3; p = p_1 + 1; while( !IsPrime(p) ) {p_1 = 3*p_1; p = p_1 + 1;} cout << p << endl; }