33 lines
1.7 KiB
Text
33 lines
1.7 KiB
Text
;Definitions (as per number theory):
|
|
::* The '''prime(''p'')''' is the ''' ''p''<sup>th</sup> prime.
|
|
:::::* '''prime(1)''' is '''2'''
|
|
:::::* '''prime(4)''' is '''7'''
|
|
::* A ''' strong prime''' is when <big>'''prime(''p'')'''</big> is <big>'''>''' '''[prime(''p''-1) + prime(''p''+1)] ÷ 2</big>'''
|
|
::* A ''' weak prime''' is when <big>'''prime(''p'')'''</big> is <big>'''<''' '''[prime(''p''-1) + prime(''p''+1)] ÷ 2</big>'''
|
|
|
|
|
|
|
|
Note that the definition for '''strong primes''' is different when used in the context of cryptography.
|
|
|
|
|
|
;Task:
|
|
::* Find and display (on one line) the first '''36''' strong primes.
|
|
::* Find and display the ''count'' of the strong primes below 1,000,000.
|
|
::* Find and display the ''count'' of the strong primes below 10,000,000.
|
|
::* Find and display (on one line) the first '''37''' weak primes.
|
|
::* Find and display the ''count'' of the weak primes below 1,000,000.
|
|
::* Find and display the ''count'' of the weak primes below 10,000,000.
|
|
::* (Optional) display the ''counts'' and "below numbers" with commas.
|
|
|
|
Show all output here.
|
|
|
|
|
|
;Related Task:
|
|
::* [[Safe primes and unsafe primes]].
|
|
|
|
|
|
;Also see:
|
|
::* The OEIS article [[oeis:A051634|A051634: strong primes]].
|
|
::* The OEIS article [[oeis:A051635|A051635: weak primes]].
|
|
<br><br>
|
|
|