摘要 |
PROBLEM TO BE SOLVED: To greatly reduce the processing time required for extracting a prime number and to simply extract a prime number in an arbitrary order by extracting the prime number through an efficient processing based on an advanced theory. SOLUTION: A prime number in next order candidate is computed from a prime number in precedent order and a verification is made to determine whether the candidate is a prime number or not by an already computed prime number (S1 and S2). If the prime number candidate is larger than a certain value, a processing is executed to reduce the verification time (S3). Then, a front and back order prime number product, which includes the prime number candidate and divides, is computed (S4). Then, the prime number candidate is divided by the computed prime number, which constitutes the prime number product in precedent order, to verify whether the candidate is a prime number or not (S5). Then, a computed prime number, which is smaller than the square root of the prime number candidate and is closest to the square root, is computed (S6). Then, the prime number candidate, which is not verified in S5, is divided by the prime number, which is larger than the maximum computed prime number that constitutes the prime number product in precedent order, is smaller than the square root of the prime number candidate and is in between the prime number that is closest to the square root, to verify whether it is a prime number or not (S7).
|