Average Primes
Moderator: Michael Wallace
- Joseph Bolas
- Fanatic
- Posts: 2446
- Joined: Mon Jan 21, 2008 9:19 am
- Location: Liverpool, UK
Average Primes
I'm not good at solving these puzzles so lets try setting one . Hope this ain't too easy.
Find three different two-digit primes, where the average of any two is a prime, and the average of all three is a prime.
Find three different two-digit primes, where the average of any two is a prime, and the average of all three is a prime.
Re: Average Primes
I eventually gave up on this, so I wrote a program to solve it. The result: No solutions.
Nevermind, I've removed the faulty 6 characters and I see the solution. I won't reveal it for anyone who wants to get it 'properly'.
Nevermind, I've removed the faulty 6 characters and I see the solution. I won't reveal it for anyone who wants to get it 'properly'.
- Charlie Reams
- Site Admin
- Posts: 9494
- Joined: Fri Jan 11, 2008 2:33 pm
- Location: Cambridge
- Contact:
Re: Average Primes
Is there actually any attack on this except brute force?
- Joseph Bolas
- Fanatic
- Posts: 2446
- Joined: Mon Jan 21, 2008 9:19 am
- Location: Liverpool, UK
Re: Average Primes
I believe this a trial and error type puzzle, but to make it more solveable I will give a hint towards the numbers. Imagine if the answer was 13, 29 and 67, these numbers are made up of 6 different digits (1, 2, 3, 6, 7 and 9). The 3 numbers you are after are only made up of 3 different digits.Charlie Reams wrote:Is there actually any attack on this except brute force?
Hopefully that has made it easier to solve, but not too easy.
Re: Average Primes
I think you can reduce the search space by saying that all the primes have to be congruent mod 4, to ensure the average of any 2 is odd, and congruent mod 3 to ensure the average of all 3 is an integer. Unless I'm missing something clever, it's just brute force after that.Charlie Reams wrote:Is there actually any attack on this except brute force?
- Joseph Bolas
- Fanatic
- Posts: 2446
- Joined: Mon Jan 21, 2008 9:19 am
- Location: Liverpool, UK
Re: Average Primes
If I give youse one of the 2-number averages then it should make it easier to solve, right?
One of the averages is 29.
One of the averages is 29.
-
- Kiloposter
- Posts: 1955
- Joined: Mon Jan 21, 2008 9:02 am
- Location: UK
Re: Average Primes
I looked at this problem during lunch today, and did work out a strategy which comes to a solution with not too much brute force or trial and error. Not time to give my method now, as the forum's due to go down in just over five minutes. I'll post again later when it's back up and running.
Briefly, though, I was concentrating on the units digits of the numbers involved, and the number of different combinations to try was much lower than I expected.
Nice puzzle, Joseph.
Briefly, though, I was concentrating on the units digits of the numbers involved, and the number of different combinations to try was much lower than I expected.
Nice puzzle, Joseph.
-
- Kiloposter
- Posts: 1955
- Joined: Mon Jan 21, 2008 9:02 am
- Location: UK
Re: Average Primes
I guess the upgrade's been done now. So here's my method. It probably takes less time to do than to read.
My method starts by considering only the final digit of the primes involved.
Any prime beyond 5 must end with 1, 3, 7 or 9. When we combine any two of our three, we cannot total a multiple of 10, otherwise their average would not be prime. This means that our three numbers cannot have three different final digits. (Otherwise we’d have a 1 combined with a 9, or a 3 combined with a 7.) We must therefore have at least two of our primes ending with the same digit.
Now let’s suppose those two primes both end in 9. What are the possibilities for the third prime? It can’t end in 1, because we can’t combine 9 with 1. It can’t in 7, because that would give a total ending in 5, yielding an average, if it is an integer, ending in 5. Therefore we’d need three 9s or two 9s and a 3.
Similar reasoning works if the two primes end in 7, or in 3. or in 1.
Now, let’s see what possible pairs of 9s we can have. Primes ending in 9 are 19, 29, 59, 79, 89. But before trying all 10 possible pairs, we can eliminate a lot of the work by a little more thought. Two numbers ending in 9 will have an average ending in 4 or 9. In order for the average to end in 9, which we need, the penultimate digits of the two numbers must either be both odd, or both even. We therefore only need to look at 29 with 89, or any two from 19, 59 79. And that’s the first very brief bit of brute force. Only the 29 and 89 pairing yields a prime average.
Similar reasoning can then be applied to pairs of 7s, pairs of 3s and pairs of 1s. We get one pair of 7s, two pairs of 3s and one pair of 1s.
Can we have three numbers ending in 9 for our final solution? No. Because this would mean we’d need three pairs of 9s yielding a prime average. Similarly we can’t have three numbers ending in 7, or in 3, or in 1.
Now back to the 9s again. For the solution to be based on two 9s, we now know that the numbers must be 29, 89 and a prime ending in 3. Primes ending in 3 are 13, 23, 43, 53, 73, 83. But once again we don’t need to check them all against 29 and 89. We only need to check those whose penultimate digit is odd, otherwise the average, when combined with 29 or with 89 will end in 6. Brute force again – just three to try – shows that 29, 89 and 53 is a possible set.
Similar reasoning gives just three other possible sets from pairs of 7s, pairs of 3s, and pairs of 1s.
The final bit of brute force involves looking at each of the four sets of three to see which has a prime average. Sure enough only one does, and that is the solution.
My method starts by considering only the final digit of the primes involved.
Any prime beyond 5 must end with 1, 3, 7 or 9. When we combine any two of our three, we cannot total a multiple of 10, otherwise their average would not be prime. This means that our three numbers cannot have three different final digits. (Otherwise we’d have a 1 combined with a 9, or a 3 combined with a 7.) We must therefore have at least two of our primes ending with the same digit.
Now let’s suppose those two primes both end in 9. What are the possibilities for the third prime? It can’t end in 1, because we can’t combine 9 with 1. It can’t in 7, because that would give a total ending in 5, yielding an average, if it is an integer, ending in 5. Therefore we’d need three 9s or two 9s and a 3.
Similar reasoning works if the two primes end in 7, or in 3. or in 1.
Now, let’s see what possible pairs of 9s we can have. Primes ending in 9 are 19, 29, 59, 79, 89. But before trying all 10 possible pairs, we can eliminate a lot of the work by a little more thought. Two numbers ending in 9 will have an average ending in 4 or 9. In order for the average to end in 9, which we need, the penultimate digits of the two numbers must either be both odd, or both even. We therefore only need to look at 29 with 89, or any two from 19, 59 79. And that’s the first very brief bit of brute force. Only the 29 and 89 pairing yields a prime average.
Similar reasoning can then be applied to pairs of 7s, pairs of 3s and pairs of 1s. We get one pair of 7s, two pairs of 3s and one pair of 1s.
Can we have three numbers ending in 9 for our final solution? No. Because this would mean we’d need three pairs of 9s yielding a prime average. Similarly we can’t have three numbers ending in 7, or in 3, or in 1.
Now back to the 9s again. For the solution to be based on two 9s, we now know that the numbers must be 29, 89 and a prime ending in 3. Primes ending in 3 are 13, 23, 43, 53, 73, 83. But once again we don’t need to check them all against 29 and 89. We only need to check those whose penultimate digit is odd, otherwise the average, when combined with 29 or with 89 will end in 6. Brute force again – just three to try – shows that 29, 89 and 53 is a possible set.
Similar reasoning gives just three other possible sets from pairs of 7s, pairs of 3s, and pairs of 1s.
The final bit of brute force involves looking at each of the four sets of three to see which has a prime average. Sure enough only one does, and that is the solution.
- Joseph Bolas
- Fanatic
- Posts: 2446
- Joined: Mon Jan 21, 2008 9:19 am
- Location: Liverpool, UK
Re: Average Primes
I must admit, when I first solved this one, I just did a trial and error thing. I started with one number and then took all possible combinations of that 1 and the other prime numbers and then saw which pairs averaged out as a prime.Howard Somerset wrote:I looked at this problem during lunch today, and did work out a strategy which comes to a solution with not too much brute force or trial and error. Not time to give my method now, as the forum's due to go down in just over five minutes. I'll post again later when it's back up and running.
Briefly, though, I was concentrating on the units digits of the numbers involved, and the number of different combinations to try was much lower than I expected.
Nice puzzle, Joseph.
Then I took those prime-averaging pairs and them added a 3rd prime to each to see which set of three averaged to a prime. Once I had done that I checked to make sure that the other 2-prime pairs of that set of three averaged to a prime also.
It didn't take me long (going from the number I first started with) to find a set of 3 that worked. With these types of puzzles there is normally only 1 solution, which I am hoping is what everyone else is getting ,
-
- Post-apocalypse
- Posts: 13312
- Joined: Mon Jan 21, 2008 10:37 pm
Re: Average Primes
Did we get an answer to this?
- Joseph Bolas
- Fanatic
- Posts: 2446
- Joined: Mon Jan 21, 2008 9:19 am
- Location: Liverpool, UK
Re: Average Primes
Howard has explained how to work it out step by step, but I think because theres quite a bit of bruce force required to solve this, most have decided not too. I think it was harder than I implied .
-
- Post-apocalypse
- Posts: 13312
- Joined: Mon Jan 21, 2008 10:37 pm
Re: Average Primes
But what is the answer?Joseph Bolas wrote:Howard has explained how to work it out step by step, but I think because theres quite a bit of bruce force required to solve this, most have decided not too. I think it was harder than I implied .
- Joseph Bolas
- Fanatic
- Posts: 2446
- Joined: Mon Jan 21, 2008 9:19 am
- Location: Liverpool, UK
Re: Average Primes
The answer is 11, 47 and 71:Gevin-Gavin wrote:But what is the answer?Joseph Bolas wrote:Howard has explained how to work it out step by step, but I think because theres quite a bit of bruce force required to solve this, most have decided not too. I think it was harder than I implied .
(11 + 47) / 2 = 58/2 = 29
(11 + 71) / 2 = 82/2 = 41
(47 + 71) / 2 = 118/2 = 59
(11 + 47 + 71) / 3 = 129/3 = 43