Show there is no prime in a range of numbers

How do I show that except for 5039, there is no prime between 5033 and 5047. I just need a nudge in the right direction, no idea how to start the problem :(

-
That's a rather small range of numbers (just ~15 of them). Why don't you look for small factors of them, one number at a time? As a start, all even numbers in that list are divisible by 2. :) –  Srivatsan Nov 8 '11 at 22:07
Recall that a number is divisible by $3$ if and only if the sum of the digits is divisible by $3$. If you write down each number between those two, that is $5034, 5035, \dots , 5046$ you'll notice that each one is either even, divisible by $3$ or divisible by $5$ except 5039. That completes proof. –  Eric Naslund Nov 8 '11 at 22:14
@EricNaslund How about 5041? It turns out to be $71^2$, but I know of no easy way to get that result. Of course, if you have a calculator handy, that changes everything. –  Arthur Nov 9 '11 at 0:00
@Arthur: Eric’s argument takes care of everything but $5041$. When it doesn’t succumb to the easy tests for $2,3,5$, and $11$, the fact that $50$ is just a little over $7^2$ and the number ends in $1$ could suggest trying $71^2$. Even if you think that you’ll have to test everything the hard way, you’ll want to know how far you need to go, so you’ll want $\sqrt{5041}$ anyway. –  Brian M. Scott Nov 9 '11 at 0:26

It is also good to remember that $7! = 5040$. Hence, among the integers from $[7! - 7, 7!+7]$ the only ones that could be prime are $7! \pm 1$. But $7! + 1 = 5041 = 71^2$.

Hence, the only number that can be prime is $7!-1$.

-

Recall that a number is divisible by $3$ if and only if the sum of the digits is divisible by $3$.

If you write down each number between those two, that is $5034, 5035, \dots , 5046$ you'll notice that each one is either even, divisible by $3$ or divisible by $5$ except 5039 and 5041. Remembering our table of squares, $71^2=5041$, so that completes proof.

-
You didn't mention divisible by 7 BTW. 5033 and 5047 are both divisible by 7. =) –  Parth Kohli Dec 22 '12 at 18:36

Knowing that a composite number will always be a product of primes, let's apply some tests and see the numbers that are factors of each. Note that I may not mention all the factors since one known factor can disprove everything.

Let's begin by scratching out even numbers from the list. Now, for the odd ones.

• $5033:7$
• $5 0 35: 5$
• $5037:3$
• $5041:71$
• $5043:3$
• $5045 : 5$
• $5047: 7$

So, the only prime number now is $5039$ which is good enough to complete the proof.

-