Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Apart from 3, 5, 7, there cannot be three consecutive odd numbers which are all primes, as is well known. I wonder how this fact* can be used to calculate the upper bound in the title for any n.

*: Whence the condition that the integers be greater than 3

share|improve this question

2 Answers 2

In any $n$ consecutive odd integers, there are $\lfloor n/3\rfloor$ disjoint triples of $3$ consecutive odd integers, so at least that many of the integers are divisible by $3$. Therefore (if all the integers are greater than $3$) there are at least $\lfloor n/3 \rfloor$ composites and at most $n - \lfloor n/3 \rfloor = \lceil 2n/3 \rceil$ primes.

EDIT: For computations involving $\lfloor \ldots \rfloor$ and $\lceil \ldots\rceil$, it's often best to "unwind" the definition. $x = \lfloor n/3 \rfloor$ means that $x$ is an integer with $x \le n/3 < x + 1$. Then $n - \lfloor n/3 \rfloor = n - x$ is an integer with $n - x - 1 < 2n/3 \le n - x$. And that's the definition of $\lceil 2n/3 \rceil$.

share|improve this answer
Many thanks for your reply. However, what if n does not divide 3? Consider, for example, n=4. –  user82365 Jun 13 '13 at 22:51
$\lfloor 4/3 \rfloor = 1$. Look up "floor" and "ceiling". –  Robert Israel Jun 14 '13 at 6:07
Done! Now I see, thanks. Would you please just add one reference as to how to compute the subtraction at the end? Specifically, as to why the result is a ceiling. –  user82365 Jun 14 '13 at 7:19
Perfect! Thanks again –  user82365 Jun 14 '13 at 8:53

You can reduce the upper bound in many cases by proving that of the remaining numbers, some have to be divisible by $5, 7, 11$ etc. The first example is $n = 8$. You can have $6$ numbers not divisible by $3$, but only if the numbers are $6k+5$ to $6k+19$, where $6k+5$, $6k+7$, $6k+11$, $6k+13$, $6k+17, 6k+19$ are not divisible by $3$. But no matter how you choose k, one of these is divisible by $5$, so there can be only $5$ instead of $6$ primes. For large $n$, finding the upper bound is quite difficult.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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