blob: bf2fb82d9b1497bbf53cc7f88c7de5d086f2512c [file] [log] [blame]
sewardj0e4096b2005-09-28 11:25:10 +00001
2#include <stdio.h>
njndd8cff82005-09-28 14:49:40 +00003#include <math.h>
sewardj0e4096b2005-09-28 11:25:10 +00004
5int isprime ( int n )
6{
7 int m;
njndd8cff82005-09-28 14:49:40 +00008 int sqrt_n = sqrt(n);
9 for (m = 2; m <= sqrt_n+1; m++) // +1 in case of obscure rounding error
sewardj0e4096b2005-09-28 11:25:10 +000010 if ((n % m) == 0) return 0;
11 return 1;
12}
13
14int main ( int argc, char** argv )
15{
16 int i;
17 for (i = 79000; i < 81000; i++)
18 if (isprime(i)) { printf ( "%d ", i ); fflush(stdout); }
19 return 0;
20}