0

How would one modify Euclid's proof of infinite primes to generate a sequence of distinct prime numbers only? How can you prove that each element in the sequence generated by the modified algorithm is a prime number different from all the previous primes in the sequence?

Example- In this algorithm,Given the current list of primes p1 , … pn , you multiply them together then add 1 . This gives a number x=q1..qn +1. Here x need not be prime and I was wondering how to modify the algorithm so the "x's" generated as such would be prime numbers

Bill Dubuque
  • 272,048
  • Not sure I follow. That's what Euclid's proof does. To be sure, Euclid gives you a number which you then need to factor (highly non-trivial), but that is about as good as it gets. – lulu Dec 05 '18 at 00:24
  • In this algorithm,Given the current list of primes p1 , … pn , you multiply them together then add 1 . This gives a number x=q1..qn +1. Here x need not be prime and I was wondering how to modify the algorithm so the "x's" generated as such would be prime numbers – coderrina Dec 05 '18 at 00:27
  • Right, so just let $p_{n+1}$ be the least prime factor of $1+\prod_{i=1}^np_i$. – lulu Dec 05 '18 at 00:28
  • 1
    sorry, I didnt follow. how would I check that? – coderrina Dec 05 '18 at 00:29
  • 1
    The point of Euclid's proof is that $1+\prod_{i=1}^np_i$ is clearly prime to $p_1,\cdots, p_n$. Thus no prime factor of it could possibly be one of the known $p_i$. I just picked the least one for specificity. You could have chosen the largest one if you'd prefer. – lulu Dec 05 '18 at 00:31

1 Answers1

2

Suppose you already have a list of primes $\{p_1,p_2,...p_n\}$, then $s=p_1p_2...p_n+1$does not have $p_1,...,p_n$ as prime divisors. So any prime divisor,call it $p_{n+1}$ of $s$ is a new primes not in the list of primes above. So then you can make a new list $\{p_1,...,p_n,p_{n+1}\}$ and do the same thing with the new list. Note that product of all prime numbers up to 1001 is greater than the number of atoms in the universe. It would take a computer so long to deduce if that number plus 1 is a prime or not that the universe will have ended.

user614287
  • 1,147
  • 1
    Just a little correction, the new prime $p_{n+1}$ is a prime factor of $s$, but $s$ is not necessary prime, so in general $p_{n+1}\neq s$. – user9077 Dec 05 '18 at 00:32
  • 1
    In particular, if we choose the smallest prime divisor, we get http://oeis.org/A000945: 2, 3, 7, 43, 13, 53, 5, 6221671, 38709183810571, 139, 2801, 11, 17, 5471, ... – Chris Culter Dec 05 '18 at 00:40
  • This is an example for the algorithm I need to modify. Suppose we start with empty list.Taking empty product and adding 1 gives the number 2(prime)

    Our list now consists of 2 . Taking product of all the elements in this list and adding 1 gives the number 3 (prime)

    list: 2 , 3 . Take the product of all the elements in this list and add 1 . This gives 7 (prime)

    if we go to the list with 2 , 3 , 7 , 43 . Take the product of elements in this list and add 1 . This gives the number 1807 (not prime) so What would be the check to make a new list for 1807?

    – coderrina Dec 05 '18 at 00:48
  • @coderrina You need to compute a prime factor of it (possibly itself), i.e. integer factorization is required if you seek a list of primes (but not for a list of coprimes). – Bill Dubuque Dec 05 '18 at 01:05