Composite Numbers with 1 Prime

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.

• Are you looking for at most one prime, or exactly one prime? If it's the former, the usual example is that $n!+2, n!+3, \ldots, n!+n$ are all composite. – MJD Apr 19 '14 at 5:44
• I'm looking for exactly one prime, @MJD – Jason Chen Apr 19 '14 at 5:44
• In the second line, I said that it needed to be 2011 numbers long. – Jason Chen Apr 19 '14 at 5:48

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.

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.

• 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 5: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 6:02
• Your answer was better than the other one, anyway. – MJD Apr 19 '14 at 6:03
• @MJD: PARI/GP can do this easily. – Charles Apr 22 '14 at 20:52