50 lines
2.4 KiB
Text
50 lines
2.4 KiB
Text
A '''long prime''' (as defined here) is a prime number whose reciprocal (in decimal) has
|
|
a ''period length'' of one less than the prime number.
|
|
|
|
|
|
'''Long primes''' are also known as:
|
|
:::* base ten cyclic numbers
|
|
:::* full reptend primes
|
|
:::* golden primes
|
|
:::* long period primes
|
|
:::* maximal period primes
|
|
:::* proper primes
|
|
|
|
|
|
Another definition: primes '''p''' such that the decimal expansion of '''1/p''' has period '''p-1''', which is the greatest period possible for any integer.
|
|
|
|
|
|
;Example:
|
|
'''7''' is the first long prime, the reciprocal of seven
|
|
is <big><sup>'''1'''</sup>'''/'''<sub>'''7'''</sub></big>, which
|
|
is equal to the repeating decimal fraction '''0.142857<u>142857</u>···
|
|
|
|
The <u>length</u> of the ''repeating'' part of the decimal fraction
|
|
is six, (the underlined part) which is one less
|
|
than the (decimal) prime number '''7'''.
|
|
<br>Thus '''7''' is a long prime.
|
|
|
|
|
|
There are other (more) general definitions of a '''long prime''' which
|
|
include wording/verbiage for bases other than ten.
|
|
|
|
|
|
;Task:
|
|
:* Show all long primes up to '''500''' (preferably on one line).
|
|
:* Show the ''number'' of long primes up to ''' 500'''
|
|
:* Show the ''number'' of long primes up to ''' 1,000'''
|
|
:* Show the ''number'' of long primes up to ''' 2,000'''
|
|
:* Show the ''number'' of long primes up to ''' 4,000'''
|
|
:* Show the ''number'' of long primes up to ''' 8,000'''
|
|
:* Show the ''number'' of long primes up to '''16,000'''
|
|
:* Show the ''number'' of long primes up to '''32,000'''
|
|
:* Show the ''number'' of long primes up to '''64,000''' (optional)
|
|
:* Show all output here.
|
|
|
|
|
|
;;;Also see:
|
|
:* [[wp:Full_reptend_prime|Wikipedia: full reptend prime]]
|
|
:* [http://mathworld.wolfram.com/FullReptendPrime.html MathWorld: full reptend prime]
|
|
:* [[oeis:A001913|OEIS: A001913]]
|
|
<br><br>
|
|
|