7
Primality Test Rodolfo A. Nieves Rivas [email protected] Abstract This paper presents a primality test based on some theorems that allow to create the bases for its development and reliability in polynomial time. In other words this primality test faces the problem of determining whether a given number (n) is prime or not and likewise can make an algorithm with which to obtain a random prime number given an input. This fact is known as the problem of primality and all this leads to a simple way of solving this problem which is the objective of this research. Keywords : Test, algorithm, prime Introduction There exist until now some tests of primality which have specific applications to solve the primality issues, which present certain limitations that lead to consider them non satisfactory to solve the determination whether a given number (n) is prime or not. One of the advantages of this new test of primality consists of the algorithm design to develop the software, avoids factorization which is the greatest obstacle up to date practically because it has not been found a solution that allows for measuring it in polynomial time and this leads us an optimal development which guarantees the degree of accuracy. By all of the above we present this research work to offer to the scientific community the bases which guarantees a definite solution to this issue.

A Simple Primality Test

Embed Size (px)

DESCRIPTION

This paper presents a primality test based on some theorems that allow to create the bases for its development and reliability in polynomial time.

Citation preview

Page 1: A Simple Primality Test

Primality Test

Rodolfo A. Nieves Rivas

[email protected]

Abstract

This paper presents a primality test based on some theorems that allow to create the bases

for its development and reliability in polynomial time.

In other words this primality test faces the problem of determining whether a given number (n) is

prime or not and likewise can make an algorithm with which to obtain a random prime number

given an input. This fact is known as the problem of primality and all this leads to a simple

way of solving this problem which is the objective of this research.

Keywords: Test, algorithm, prime

Introduction

There exist until now some tests of primality which have specific applications to solve the

primality issues, which present certain limitations that lead to consider them non

satisfactory to solve the determination whether a given number (n) is prime or not.

One of the advantages of this new test of primality consists of the algorithm design to

develop the software, avoids factorization which is the greatest obstacle up to date

practically because it has not been found a solution that allows for measuring it in

polynomial time and this leads us an optimal development which guarantees the degree of

accuracy.

By all of the above we present this research work to offer to the scientific community the

bases which guarantees a definite solution to this issue.

Page 2: A Simple Primality Test

Statement of the Problem

To develop an algorithm that allows a software design to be apply to a test of primality.

Theoretical Framework

Definition 1: A test (or screening) of primality is an algorithm that, given an input number

n, is unable to verify the hypothesis of a theorem whose conclusion is that n is composite.

Definition 2: A primality test algorithm (or true primality test) is a deterministic algorithm

that, given an input number n, verifies the hypothesis of a theorem whose conclusion is that

n is prime. A primality test is the computational verification of such theorem.

Thus one can speak of two degrees of certainty: primality testing (there is mathematical

certainty) and primality testing (there is certainty practice).

Theoretical Basis

Theorem 1: The product of n different primes which has two to the power of n divisors.

Theorem 2: The product of two different primes has four divisors and nothing more than

four.

Theorem 3: If the product of two different primes has four divisors and not more than four.

Then the divisors are: The product, the two primes and the unit.

Theorem 4: If a multiple of ten plus five has only and not more than own four divisors.

Then it is product of two different primes from which one of them is number five.

Escolium 1: And the four own divisors of a multiple of ten plus five are: The unit, number

five, the multiple of ten plus five and another prime.

Corollary 1: If the four own divisors of a multiple of ten plus are: The unit, number five,

the multiple of ten plus five and another prime. Then the multiple of ten plus five is the

product of five by the other prime.

Theorem 5: All natural number that ends in five is a multiple of ten plus five.

Criterion 1: To proof that two different numbers are primes, only is necessary and

sufficient to determine that their products have four and not more than four own divisors.

Page 3: A Simple Primality Test

Theorem 6: If the product of two odd numbers, where one of them is number five, has

more than four own divisors. Then the other number is composite.

Analysis and Results

Algorithm: For obtaining a random prime number

Based on: Theorems

Input: Choose an arbitrary natural number (n) with any amount of digits, except that the last

digit has to be number five

Do ((x - 5)/10) – 1 iterations until find an exact quotient.

Justification

Since: The input is of the form: 10.k + 5 = x

Where: K is constant

And when: The quotient is exact and of the form: 10.K + 5 / 10.m + 5

Let: m and k be natural

For: 0 < m < k

Then: 2.n + 1 is equal to the quotient

If: During the execution of the search, you find an exact quotient; stop the execution

and the Output would be a composite number.

Then: by the above is proved that at least exist a value for m ∈ IN where n is natural.

Output: 10.k + 5 / 10.M + 5 = 2.n + 1 (Composite)

Where: k = n and m =0

Page 4: A Simple Primality Test

If: During the search, you don’t find an exact quotient, do all the iterations and the output in

this case is a prime number.

Then: by the above is proved that doesn’t exist any value natural for m where n is natural.

Output: 10.k + 5 / 10.M + 5 = 2.n + 1 (Prime)

Where: k = n and m =0

We would like to point out that once made the analysis and have obtained this result which

allows us to proof that we have fulfilled the objective of this research, which was to design

an algorithm that help us to design a software which guarantees an efficient primality test

sufficient and satisfactory that allows to ensure when a number is prime or composite.

Since the number of iterations is determined by the number of input, this guarantees that the time is polynomial and the theorems which are the foundations of the development of this algorithm, are those of a deductive form we cleared any doubts about validity in the

execution of the software, which is proved inductively.

Development of Internal Software:

10.k + 5 / 10.m + 5 = 2.n + 1

10.40 + 5 / 10.0 + 5 = 2.40 + 1 (a composite)

10.40 + 5 / 10.l + 5 = 2.13 + 1

10.40 + 5 / 10.2 + 5 ≠ 2.m + 1

10.40 + 5 / 10.3 + 5 ≠ 2.m + 1

10.40 + 5 / 10.4 + 5 = 2.4 + 1

10.40 + 5 / 10.5 + 5 ≠ 2.m + 1

10.40 + 5 / 10.13 + 5 = 2.1 + 1

10.40 + 5 / 10.40 + 5 = 2.0 + 1

Page 5: A Simple Primality Test

Remark 1: When the division is exact in at least one of its intermediates steps during the

algorithm process likewise in the software stops and the next step is executed: which is to

do the quotient of the end terms and the final result or input is a composite

10.k + 5 / 10.m + 5 = 2.n + 1

10.3 + 5 / 10.0 + 5 = 2.3 + 1 (a prime)

10.3 + 5 / 10.l + 5 ≠ 2.2 + 1

10.3 + 5 / 10.2 + 5 ≠ 2.1 + 1

10.3 + 5 / 10.3 + 5 = 2.0 + 1

Remark 2: When the division is not exact in all and each one of the intermediate steps the

algorithm process likewise in the software does not stop until it has done all and each one

of the steps and when it ends, it executes the following step: which is to determine the

quotient of the end terms and the final result is a prime number.

Page 6: A Simple Primality Test

Conclusion and Recommendations

Once presented all the obtained results through the algorithm analysis we got to the

following conclusion with the development of a software designed with the bases proved in

this research which guarantee a broad application in the final solution of problems such as:

- Mersenne primes

- Fermat primes

- Gauss primes

- Golbach’s hypothesis (Even and Odd)

- Riemann’s hypothesis

- And all problems related to prime numbers among others.

We would like to point out that all of these problems are still unsolved since until to date

their difficulty was in the solution to the problem presented herein and we propose this

software design in order to let science enhancement which is the purpose of every

researcher.

Page 7: A Simple Primality Test

References

es.wikipedia.org/wiki/Test_de_primalidad - 77k –

www.monografias.com/trabajos15/algoritmos/algoritmos.shtml - 50k -

www.psicoactiva.com/tests.htm - 34k

www.primenumbersformula.com/ - 55k –

es.wikipedia.org/wiki/Criptografía