Pierpont primes: Difference between revisions

Content added Content deleted
(nine is prime now?)
Line 1,974: Line 1,974:
62207 73727 131071 139967 165887 294911 314927 442367 472391 497663
62207 73727 131071 139967 165887 294911 314927 442367 472391 497663
524287 786431 995327 1062881 2519423 10616831 17915903 18874367 25509167 30233087
524287 786431 995327 1062881 2519423 10616831 17915903 18874367 25509167 30233087
</pre>

=={{header|Ring}}==
<lang ring>
load "stdlib.ring"

see "working..." + nl

pierpont = []
limit1 = 18
limit2 = 8505000
limit3 = 50
limit4 = 21
limit5 = 30500000

for n = 0 to limit1
for m = 0 to limit1
num = pow(2,n)*pow(3,m) + 1
if isprime(num) and num < limit2
add(pierpont,num)
ok
if num > limit2
exit
ok
next
next

pierpont = sort(pierpont)

see "First 50 Pierpont primes of the first kind:" + nl + nl

for n = 1 to limit3
see "" + n + ". " + pierpont[n] + nl
next

see "done1..." + nl

pierpont = []

for n = 0 to limit4
for m = 0 to limit4
num = pow(2,n)*pow(3,m) - 1
if isprime(num) and num < limit5
add(pierpont,num)
ok
if num > limit5
exit
ok
next
next

pierpont = sort(pierpont)

see "First 50 Pierpont primes of the second kind:" + nl + nl

for n = 1 to limit3
see "" + n + ". " + pierpont[n] + nl
next

see "done2..." + nl
</lang>
Output:
<pre>
working...
First 50 Pierpont primes of the first kind:

1. 2
2. 3
3. 5
4. 7
5. 13
6. 17
7. 19
8. 37
9. 73
10. 97
11. 109
12. 163
13. 193
14. 257
15. 433
16. 487
17. 577
18. 769
19. 1153
20. 1297
21. 1459
22. 2593
23. 2917
24. 3457
25. 3889
26. 10369
27. 12289
28. 17497
29. 18433
30. 39367
31. 52489
32. 65537
33. 139969
34. 147457
35. 209953
36. 331777
37. 472393
38. 629857
39. 746497
40. 786433
41. 839809
42. 995329
43. 1179649
44. 1492993
45. 1769473
46. 1990657
47. 2654209
48. 5038849
49. 5308417
50. 8503057
done1...
First 50 Pierpont primes of the second kind:

1. 2
2. 3
3. 5
4. 7
5. 11
6. 17
7. 23
8. 31
9. 47
10. 53
11. 71
12. 107
13. 127
14. 191
15. 383
16. 431
17. 647
18. 863
19. 971
20. 1151
21. 2591
22. 4373
23. 6143
24. 6911
25. 8191
26. 8747
27. 13121
28. 15551
29. 23327
30. 27647
31. 62207
32. 73727
33. 131071
34. 139967
35. 165887
36. 294911
37. 314927
38. 442367
39. 472391
40. 497663
41. 524287
42. 786431
43. 995327
44. 1062881
45. 2519423
46. 10616831
47. 17915903
48. 18874367
49. 25509167
50. 30233087
done2...
</pre>
</pre>