0
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ 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. $\endgroup$ – MJD Apr 19 '14 at 5:44
  • $\begingroup$ I'm looking for exactly one prime, @MJD $\endgroup$ – Jason Chen Apr 19 '14 at 5:44
  • $\begingroup$ In the second line, I said that it needed to be 2011 numbers long. $\endgroup$ – Jason Chen Apr 19 '14 at 5:48
2
$\begingroup$

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.

$\endgroup$
2
$\begingroup$

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.