fork download
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int n, r, b, m, i, c = 0;
  6. for (n = 3; c < 99; n += 2)
  7. {
  8. r = 1;
  9. b = 2;
  10. for (i = n; i; i /= 2)
  11. {
  12. if (i & 1)
  13. r = r * b % n;
  14. if (b * b < b)
  15. return 1;
  16. b = b * b % n;
  17. }
  18. if (r != 2)
  19. continue;
  20.  
  21. for (i = n / 4 | 1; n % i; i -= 2);
  22. if (i > 1)
  23. printf("%d %d\n", ++c, n);
  24. }
  25. return 0;
  26. }
  27.  
Runtime error #stdin #stdout 0.25s 2248KB
stdin
Standard input is empty
stdout
1 341
2 561
3 645
4 1105
5 1387
6 1729
7 1905
8 2047
9 2465
10 2701
11 2821
12 3277
13 4033
14 4369
15 4371
16 4681
17 5461
18 6601
19 7957
20 8321
21 8481
22 8911
23 10261
24 10585
25 11305
26 12801
27 13741
28 13747
29 13981
30 14491
31 15709
32 15841
33 16705
34 18705
35 18721
36 19951
37 23001
38 23377
39 25761
40 29341
41 30121
42 30889
43 31417
44 31609
45 31621
46 33153
47 34945
48 35333
49 39865
50 41041
51 41665
52 42799