0

What is the method for finding a long sequence of consecutive composite numbers that has only 1 prime? Specifically, how to find 2011 consecutive natural numbers, 1 of which is prime.

Jason Chen
  • 1,153

2 Answers2

2

You can construct a sequence in the following manner:

1)Let us say you want the size of sequence to be n. Then find the largest prime less than $n!+2$.

2)Now all the numbers from $p$ to $n!+n$ are composite .So choose the sequence from this list and you are done.

happymath
  • 6,148
2

Here is a good way to do this.

As MJD pointed out in the comments, it is easy to find 2011 consecutive numbers which are all composite; namely, you can take 2012! + 2, 2012! + 3, ..., up to 2012! + 2012. Now, let $p$ be the smallest prime larger than 2012! + 2012. Then $p-1, p-2, p-3, ..., p-2011$ are all composite (why?) so the sequence $p-2011, p-2010, p-2009, ..., p$ contains exactly 1 prime.

jschnei
  • 1,641
  • Calculating the smallest prime above $2012!+2012$ is not so easy. I am not aware of any method for efficiently testing the primality of arbitrary 6,000-digit numbers. – MJD Apr 19 '14 at 05:54
  • It's not clear that the question is asking for an computationally efficient method (just any construction). Also, there are fairly efficient primality testing algorithms, although even these would take a while (but not ridiculously long!) to check whether a 5000 digit number is prime. – jschnei Apr 19 '14 at 06:02
  • Your answer was better than the other one, anyway. – MJD Apr 19 '14 at 06:03
  • @MJD: PARI/GP can do this easily. – Charles Apr 22 '14 at 20:52