Index                                                                                                                                                                                               Modular Sieves

A Minimal Prime Generating Theorem that suggests the Prime Difference is

 

Bhupinder Singh Anand[1]

We define a minimal prime generating algorithm which suggests that the Prime Difference, dP(n), is

Introduction

 

Do we necessarily discover the primes, as in the sieve of Eratosthenes, or can we also generate them sequentially?

 

In other words, given the first k primes, can we generate the prime difference, dP(k), without directly testing any number larger than p(k) for primality?

 

We give an affirmative answer, and define two prime number generating algorithms based on the following theorems.

 

We show that one of these is a minimal prime generating algorithm, and conjecture that it suggests the prime difference is

1.1: A Prime Number Generating Theorem

 

Theorem 1: For any given natural number k, and all ik, let p(i) denote the i'th prime, and define the sequence {aP(i): i = 1 to k} such that 0 < aP(i) < p(i), and:

 

p(k) + aP(i) ≡ 0 (mod p(i))

 

Let dP(k) be such that, for all 0 < l < dP(k), there is some i such that:

 

laP(i) (mod p(i)).

 

Then dP(k) is the Prime Difference, defined by:

 

p(k+1) - p(k) = dP(k).

 

Proof: For all 0 < l < dP(k), there is some i such that:

 

p(k) + l ≡ 0 (mod p(i)).

 

Since, by Bertrand’s Postulate ([HW60], p343), p(k+1) < 2p(k) for all natural numbers k, it follows that:

 

dP(k) < p(k)

 

Hence, p(k) + dP(k) < p(k)2, and so it is the prime p(k+1)□

1.2: A Minimal Prime Number Generating Theorem

Since a natural number, n, is prime if, and only if, it is not divisible by any prime p such that p2 < n, the above is also a proof of the following minimal prime generating theorem.

 

Theorem 2: For any given natural number k, and all ik, let p(i) denote the i'th prime, and define the sequence {aP(i): i = 1 to m} such that 0 < aP(i) < p(i), p(m)2 < p(k) < p(m+1)2, and:

 

p(k) + aP(i) ≡ 0 (mod p(i))

 

Let dP(k) be such that, for all l < dP(k), there is some i such that:

 

laP(i) (mod p(i)).

 

Then dP(k) is the Prime Difference, defined by:

 

p(k+1) - p(k) = dP(k).

2: Trim numbers

The significance of Theorem 1 is seen in the following algorithm.

 

We define Trim numbers recursively by t(1) = 2, and t(n+1) = t(n) + dT(n), where p(i) is the i'th prime and:

 

(i)      dT(1) = 1; aT(2, 1) = 1:

 

(ii)     dT(n) is the smallest even integer that does not occur in the n'th sequence:

 

{ aT(n, 1), …, aT(n, n-1)};

 

(iii)    ji ≥ 0 is selected so that, for all 0 < i ≤ (n-1):

 

0 ≤ aT(n+1, i) = {( aT(n, i) - dT(n) + ji*p(i)} < p(i)

 

It follows that the Trim number t(n+1) is, thus, a prime unless all its prime divisors are less than dT(n).

 

2.1: The Trim Number Algorithm

 

The following illustrates how Trim numbers are generated sequentially.                                

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

n

t(n)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

2

2

3

5

7

11

13

17

19

23

 

29

31

37

41

43

47

53

59

 

2

3

1

2

5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3

5

1

4

2

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4

7

1

2

3

4

11

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5

11

1

1

4

3

2

13

 

 

 

 

 

 

 

 

 

 

 

 

 

6

13

1

2

2

1

9

4

17

 

 

 

 

 

 

 

 

 

 

 

 

7

17

1

1

3