The n-primality test

PRIME NUMBER SERIES 7

The n-primality test

 

This primality test is not a probability test but an indirect test to determine clearly if a choosed uneven number greater than 1 is prime or not.

It is based on definition 6 of prime number series 1:

Because of the existence of an infinite quantity of primes and only one even prime namely 2 follows that an infinite quantity of uneven primes must exist. Because of this the definition of all primes greater then 2 is:

A prime greater than 2 is an uneven number U greater than 2, that is not divisible integrally by any uneven number u in the domain

3 \le u \le \sqrt{U}

For this reason only uneven numbers > 1 are used for this test.

With

U=2n+3 n ∈ ℕ

all uneven numbers > 1 are given, which can be selected for this test.

Solved for n gives

n=\frac{U-3}{2}

The determined n is put into the following test function t(n):

t(n)=\prod\limits_{k=0} ^{k_{max}}  \lceil1-\frac{k+\lfloor\frac{n-k}{2k+3}\rfloor(2k+3)}{n}\rceil

with

k_{max}=\lfloor{\frac{|\sqrt{2n+3}-3|}  {2}\rfloor}

and n ∈ ℕ and n≥1 as well as k ∈ ℕ und k≥0.

Legend:

\prod\limits_{k=0} ^{k_{max}} product, with running variable k from 0 up to kmax 

|x| absolute value of any value x

⌊x⌋ lower Gaussian bracket, x rounded down to the next integer

⌈x⌉ upper Gaussian bracket, x rounded up to the next integer

t(n) is either 0 or 1 for a choosed n>0 from the set of the natural numbers.

If t(n)=0, then 2n+3 is not prime for the choosed n.

If t(n)=1, then 2n+3 is prime for the choosed n.

Proof:

In prime number series 6 it has been proofed, that the formula

nkm = 2k²+6k+3+m(2k+3) ʌ k, m ∈ ℕ

provides those n, which give all composite uneven numbers greater than 2 in the formula 2n+3.

Determining all nkm, which are close by the choosed n, it can be determined, if there is any nkm, for which is valid:

n = nkm

or if there is not any nkm, which equals n, meaning:

n ≠ nkm

Establishing this deterministic it is necessary to determine any nkm from k=0 up to kmax. For value m it is enough, if only mmax is used in correlation with k in the domain from 0 up to kmax. Value mmax is that m, which is determines that  nkm-value for each k in the domain from 0 up to kmax, which is closest to the choosed n and in the extreme case equals n.

But how great are the values kmax und  mmax?

To begin with kmax:

According to definition 6, prime number series 1 is the following valid:

A prime greater than 2 is an uneven number U, that is not divisible integrally by any uneven number u in the domain 3 \le u \le \sqrt{U}.

Putting

U=2n+3 ᴧ n ∈ ℕ

and

u=2k+3 ᴧ k ∈ ℕ

into

u \le \sqrt{U}

gives

2k+3 \le \sqrt{2n+3}

The solutions for k and the selected n spread from k=0 up to k=kmax for n, k ∈ ℕ.

kmax shall be determined as a natural number. But solving for k we come into the domain of real numbers. Therefore we write for better differentiation:

2k_{max_{r}}+3 = \sqrt{2n+3}

Solved for k_{max_{r}} gives:

k_{max_{r}} = \frac{\sqrt{2n+3}-3}{2}

The real solution can be lead back into the domain of natural numbers by rounding up or down.

According to definition 6, prime number series 1 it has to be rounded down.

Additionally shall be

n_{km} \le n

The reason for this is that it shall be

\frac{n-n_{km}}{n} \ge  0

And that must be also the case for

\frac{n-n_{km_{max}}}{n} \ge  0

For this reason it is not necessary for this test to use every m in nkm , but only mmax in correlation with k.

Because k and with that kmax must be ≥ 0 and kmax

would be negative for n=1 and n=2,

\sqrt{2n+3}-3

has to be calculated as absolute value.

Thus the value for kmax is

k_{max}=\lfloor{\frac{|\sqrt{2n+3}-3|}  {2}\rfloor}

The term

\lceil\frac{n-n_{km_{max}}}{n}\rceil

can take on only the values 0 or 1, if

n=n_{km_{max}} \lceil\frac{n_{km_{max}}-n_{km_{max}}}{n}\rceil=0

n>n_{km_{max}} \lceil\frac{n-n_{km_{max}}}{n}\rceil=1

n<n_{km_{max}}

is ruled out as follows:

Substituting nkm in the formula

nkm = 2k²+6k+3+m(2k+3) ʌ k, m ∈ ℕ

by any n ∈ ℕ and letting k in the natural number domain  m turns into the real number m_{max_{r}}.

Solved for m_{max_{r}}, gives

m_{max_{r}}=\frac{n-(2k^2+6k+3)}{2k+3}

As the solution for mmax must be integer and n_{km_{max}} shall be ≤ n, m_{max_{r}} has to be rounded down. Thus we get

m_{max}=\lfloor\frac{n-(2k^2+6k+3)}{2k+3}\rfloor

Put into the formula for nkm gives

n_{km_{max}}=2k^2+6k+3+\lfloor\frac{n-(2k^2+6k+3)}{2k+3}\rfloor(2k+3)

This in his turn put into

\lceil\frac{n-n_{km_{max}}}{n}\rceil

gives

\lceil(\frac{n-(2k^2+6k+3+\lfloor\frac{n-(2k^2+6k+3)}{2k+3}\rfloor(2k+3))}{n})\rceil

This term can take on only the values 0 or 1 because of n_{km_{max}} \le n.

Is this term 0 the choosed n gives no prime in the formula 2n+3 but a composite uneven number.

Is this term 1 the choosed n can give a prime in the formula 2n+3 but not forcible.

But forming the product for all k’s from 0 up to kmax and is’nt this product 0 but 1, then it is ensured clearly with this deterministic primality test, that 2n+3 is prime. But is in this product at least one factor 0, then the entire product is 0 and it is ensured clearly with this deterministic primality test, that 2n+3 is not prime.

What had to be proved.

Examples:

n=1 → t(1)=1 → 2*1+3=5 → prime

n=10 → t(10)=1 → 2*10+3=23 → prime

n=97 → t(97)=1 → 2*97+3=197 → prime

n=1001 → t(1001)=0 → 2*1001+3=2005 → not prime

n=30997 → t(30997)=0 → 2*30997+3=61997=13*19*251 → not prime

n=30103 → t(30103)=1 → 2*30103+3=60209 → prime

The following table shows the results from n=1 up to n=20:

1234567891011121314151617181920
11011011010011001011

Following table shows the results from n=1470 up to n=1480:

14701471147214731474147514761477147814791480
00000101001

 

Munich, 24 October 2022

Gottfried Färberböck