Amazing quintuples

5 , 7 , 17 , 5, 7, 17, and 19 19 are four prime numbers such that the sum of any three of them is also prime: 5 + 7 + 17 = 29 5 + 7 + 19 = 31 5 + 17 + 19 = 41 7 + 17 + 19 = 43. \begin{aligned} 5+7+17&=29\\ 5+7+19&=31\\ 5+17+19&=41\\ 7+17+19&=43. \end{aligned} Are there 5 distinct positive primes such that the sum of any three of them is also prime?

Yes, there are infinitely many such quintuples Yes, there are a finite number of such quintuples No

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

Jordan Cahn
Mar 6, 2018

Note: This problem does not require the "distinct" condition. This solution proceeds for the case of "5 positive primes".

Notice that in the numerical example, of the primes picked, two are congruent to 1 1 mod 3 3 and two are congruent to 2 2 mod 3 3 . This is not a coincidence. In fact, every example of 4 primes where the sum of any 3 are prime must satisfy this condition.

As such, this suggests that we look at the values of the primes modulo 3. If we choose five primes, there are the following cases:

Case 1: 3 3 is not one of our primes. Let our primes be p 1 , p 2 , p 3 , p 4 , p 5 p_1,p_2,p_3,p_4,p_5 . All our primes must either be congruent to 1 1 mod 3 3 or 2 2 mod 3 3 . By the pigeonhole principle, three of our five primes must therefore be congruent to each other mod 3 3 -- WLOG say p 1 p 2 p 3 m o d 3. p_1\equiv p_2\equiv p_3\mod 3. Then p 1 + p 2 + p 3 0 m o d 3 p_1 + p_2 + p_3 \equiv 0\mod 3 and, since this sum is greater than three, it must be composite.

Edit: As noted by @Jacob Swenberg, Case 2 can be simplified using the given condition that all the primes are distinct.

Case 2: 3 3 is one of our primes. If three of our primes are 3 3 , then their sum is 9 9 . So assume that at most two of our primes are three. Let our primes be 3 , p 2 , p 3 , p 4 , p 5 3,p_2,p_3,p_4,p_5 , with the possibility that p 2 = 3 p_2=3 . Note that p 3 , p 4 , p 5 p_3,p_4,p_5 all must must be congruent to 1 1 mod 3 3 or 2 2 mod 3 3 . If they are all congruent to each other, the argument from Case 1 shows that their is not prime. If they are not all congruent, WLOG say p 3 1 m o d 3 p_3\equiv 1\mod 3 and p 4 2 m o d 3 p_4\equiv 2 \mod 3 . Then 3 + p 3 + p 4 0 m o d 3 3 + p_3 + p_4 \equiv 0\mod 3 and, since this sum cannot be 3, it must be composite.

A simpler argument (which is essentially yours) is that

Lemma: If we have 5 numbers that are chosen from 0, 1, 2, then we must either have 3 identical numbers, or 3 distinct numbers.

Corollary: The sum of these 3 numbers will be a multiple of 3.

Proof of lemma: This is an application of dilworth's theorem (or you can convince yourself directly).

Calvin Lin Staff - 3 years, 2 months ago

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# https://brilliant.org/weekly-problems/2018-03-19/advanced/
import math

def primes(n): # simple Sieve of Eratosthenes 
   odds = range(3, n+1, 2)
   sieve = set(sum([range(q*q, n+1, q+q) for q in odds],[]))
   return [2] + [p for p in odds if p not in sieve]


def combinations(iterable, r):
    pool = tuple(iterable)
    n = len(pool)
    if r > n:
        return
    indices = range(r)
    yield tuple(pool[i] for i in indices)
    while True:
        for i in reversed(range(r)):
            if indices[i] != i + n - r:
                break
        else:
            return
        indices[i] += 1
        for j in range(i+1, r):
            indices[j] = indices[j-1] + 1
        yield tuple(pool[i] for i in indices)

def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)

n = 4
r = 3
primes_ = primes(20)
print 'List of primes being examined: %s' % primes_
combos = nCr(n,r)

max_count = 0
max_ = []

for i in combinations(primes_, n):
    count = 0
    for j in combinations(i, r):
        if sum(j) in primes(400):
           count += 1
        if count > max_count:
            max_count = count

print 'Maximum number of triples out of %d possible combinations with a prime sum = %d'\
     %(combos, max_count)

for i in combinations(primes_, n):
    count = 0
    for j in combinations(i, r):
        if sum(j) in primes(400):
           count += 1
        if count == max_count:
            max_.append(i)

print 'Combos of %d numbers with the sum of %d/%d triples being prime: %s' \
    % (n, max_count, combos, max_)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
List of primes being examined: [2, 3, 5, 7, 11, 13, 17, 19]
Maximum number of triples out of 4 possible combinations with a prime sum = 4
Combos of 4 numbers with the sum of 4/4 triples being prime: [(5, 7, 17, 19)]

___________________

List of primes being examined: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97] Maximum number of triples out of 10 possible combinations with a prime sum = 9 Combos of 5 numbers with the sum of 9/10 triples being prime: [(5, 7, 17, 19, 47), (5, 7, 31, 61, 71), (5, 11, 13, 43, 83), (5, 13, 23, 43, 61), (5, 13, 41, 43, 53), (5, 13, 41, 43, 83), (5, 13, 43, 53, 83), (5, 17, 19, 37, 47), (5, 19, 29, 79, 83), (5, 23, 31, 53, 73), (5, 29, 37, 47, 97), (5, 29, 73, 79, 89), (5, 31, 47, 61, 71), (5, 37, 47, 89, 97), (7, 11, 19, 41, 53), (7, 11, 19, 41, 79), (7, 11, 41, 61, 79), (7, 13, 17, 23, 43), (7, 13, 17, 23, 73), (7, 13, 17, 37, 59), (7, 13, 23, 37, 53), (7, 13, 47, 53, 97), (7, 17, 19, 43, 47), (7, 17, 19, 47, 73), (7, 17, 23, 73, 83), (7, 17, 29, 37, 43), (7, 17, 37, 59, 83), (7, 17, 37, 73, 83), (7, 17, 47, 59, 73), (7, 19, 41, 53, 79), (7, 23, 67, 73, 83), (11, 13, 17, 23, 73), (11, 17, 31, 59, 61), (11, 19, 23, 37, 41), (11, 19, 37, 41, 53), (11, 19, 37, 41, 79), (11, 19, 37, 79, 83), (11, 29, 31, 71, 97), (11, 31, 37, 41, 59), (11, 31, 37, 59, 61), (11, 37, 41, 61, 79), (13, 17, 23, 31, 53), (13, 17, 23, 43, 71), (13, 17, 23, 67, 73), (13, 17, 31, 53, 83), (13, 17, 41, 43, 53), (13, 17, 43, 53, 71), (13, 17, 43, 53, 97), (13, 17, 43, 71, 79), (13, 17, 53, 83, 97), (13, 19, 41, 43, 47), (13, 23, 31, 53, 73), (13, 23, 37, 43, 47), (13, 23, 37, 47, 53), (13, 23, 37, 47, 67), (13, 23, 53, 71, 73), (13, 29, 37, 47, 97), (13, 31, 43, 53, 83), (13, 31, 53, 83, 97), (13, 37, 47, 89, 97), (13, 41, 43, 53, 83), (13, 41, 43, 53, 97), (13, 41, 53, 73, 97), (13, 43, 53, 71, 83), (13, 43, 53, 71, 83), (13, 43, 53, 83, 97), (13, 43, 71, 83, 97), (13, 53, 61, 83, 97), (17, 19, 37, 43, 47), (17, 19, 37, 47, 73), (17, 23, 67, 73, 83), (19, 23, 37, 41, 71), (19, 23, 37, 47, 97), (23, 29, 31, 53, 97), (23, 29, 37, 47, 97), (23, 31, 53, 73, 97), (23, 37, 47, 79, 97), (23, 41, 43, 73, 83), (23, 41, 67, 73, 83), (29, 31, 71, 79, 89), (29, 71, 73, 79, 89), (31, 43, 53, 83, 97), (31, 47, 59, 61, 73), (41, 43, 67, 73, 83)]

__________________

List of primes being examined: [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97] Maximum number of triples out of 20 possible combinations with a prime sum = 17 Combos of 6 numbers with the sum of 17/20 triples being prime: [(7, 11, 19, 41, 53, 79), (7, 17, 23, 67, 73, 83), (13, 17, 31, 53, 83, 97), (13, 17, 41, 43, 53, 97), (13, 17, 43, 53, 83, 97), (13, 41, 43, 53, 83, 97), (13, 43, 53, 71, 83, 97), (23, 41, 43, 67, 73, 83)]

Michael Fitzgerald - 3 years, 2 months ago

Everything is fine with this, but isn’t the condition given that the 5 primes must be distinct? Case 2 here could be simplified slightly - no need to consider if p_2 = 3

Jacob Swenberg - 3 years, 2 months ago

Log in to reply

Note that "two are congruent to 1 mod 3" doesn't mean that the original primes are the same. It just mean that they leave the same remainder after dividing by 3.

As it turns out, (this solution shows that) the distinct prime condition is irrelevant to the problem. If we allowed for duplicate primes, the answer is "No". Hence, restricting to no duplicate primes, the answer is "No".

Calvin Lin Staff - 3 years, 2 months ago

Log in to reply

I understand that, and I've edited my original comment to clarify - I was just wondering why, in case 2, we need to consider if 2 of our primes are 3 if we are looking at distinct primes. Interesting that that fact isn't needed to solve, but could be used to simplify reasoning a bit.

Jacob Swenberg - 3 years, 2 months ago

Log in to reply

@Jacob Swenberg Yes, we could answer the question as posed, though this solution addresses a more general case. Admittedly, it would be much better if the solution made that explicit at the start, and I've added a note to reflect that.

(In addition, there is a much better way to present the entire argument, which is the point of my comment below.)

Calvin Lin Staff - 3 years, 2 months ago

Ah, you're right. Missed that part! My original proof actually had all five distinct, but then I "fixed" it.

Jordan Cahn - 3 years, 2 months ago

I was about to complain that my software found a whole bunch, but in reviewing it I see I screwed the code up... :-(

Terry Smith - 3 years, 2 months ago

Generalizing to 5 positive integers:

  • Modify Case 1 to start with "None of the integers it congruent to 0 mod 3" instead of "3 is not one of our primes"
  • Modify Case 2 to start with "Some of our integers are congruent to 0 mod 3. If three of our integers are congruent to 0 mod 3, their sum will be divisible by 3. So assume that at most two of our integers are congruent to 0 mod 3, WLOG say p 1 p_1 and possibly p 2 p_2 . [...] Then p 1 + p 3 + p 4 0 m o d 3 p_1+p_3+p_4\equiv 0 \mod 3 and, [...]"

@Jordan Cahn : Did I get it right?

Mathias de Riese - 3 years, 2 months ago

Log in to reply

That note was actually added by the Brilliant.com admins, not me! But your proof looks good to me!

Jordan Cahn - 3 years, 2 months ago

Log in to reply

Consider 1,1,1,1,1 - in the positive integer case, you need to take into account uniqueness.

Gregory Lewis - 3 years, 2 months ago

Log in to reply

@Gregory Lewis Haha, yes indeed. I was thinking that we would get a different multiple of 3, but didn't push that thinking through completely.

Alright, if we had "integers 2 \geq2 ", then the statement would be true.

Calvin Lin Staff - 3 years, 2 months ago

Not quite. You're missing one small step that is easy to overlook.

Hint: If a number is divisible by 3, must it be non-prime?

Calvin Lin Staff - 3 years, 2 months ago

I do not understand why did you take integers that are 0 mod 3 .doesnt that imply that they are non prime?

সামিন সালেক - 3 years, 1 month ago

Log in to reply

I don't believe that I chose any integers that were 0 mod 3. Regardless, it is possible that one of the primes could be 3 itself.

Jordan Cahn - 3 years, 1 month ago
Calvin Lin Staff
Mar 23, 2018

Lemma: There are no integer solutions to a + b + c = 5 , 0 a , b , c , < 3 , a b c = 0 a+b+c = 5, 0 \leq a, b, c, < 3, abc = 0 .

Proof: Suppose such a solution exists. WLOG, a = 0 a = 0 . Then, we have 5 = b + c 2 + 2 = 4 5 = b + c \leq 2 + 2 = 4 , which is a contradiction.

Lemma: Given any 5 integers, there exist 3 whose sum is a multiple of 3.

Proof: Suppose not. There are 5 integers such that the sum of any 3 integers is not a multiple of 3.
Let a , b , c , a, b, c, represent the number of integers that leave a remainder of 0, 1, and 2 respectively when divided by 3.
Since no 3 sum to a multiple of 3, this means that 0 a , b , c < 3 0 \leq a, b, c < 3 otherwise we can take the sum of those 3.
If a b c 0 abc \neq 0 , then each of them is at least 1, and the sum of 1 number from each group will give us a multiple of 3. Thus a b c = 0 abc = 0 .
However, this contradicts the previous claim.


Corollary: Given any 5 integers, each of which is at least 2, there exist 3 whose sum is composite.

Proof: By the 2nd lemma, there exist 3 whose sum is a multiple of 3.
Since each of the integers is at least 2, their sum is at least 6. Thus, their sum is not 3.
Hence, their sum is a composite number.

Sir could u pls explain this :5=b+c<=2+2=4!!! and why did u use it??

erica phillips - 3 years, 2 months ago

Log in to reply

This is a proof by contradiction . We assume that a solution exists and try to find a/any contradiction. If there is a contradiction, then it means that the assumption is false, so there are no solutions.

Calvin Lin Staff - 3 years, 2 months ago

Log in to reply

Sir could u pls explain how did u get that b<=2+2=4,in that inequality!!!thanks

erica phillips - 3 years, 2 months ago

Log in to reply

@Erica Phillips a , b , c a, b, c are integers that are strictly less than 3. Hence, they are at most 2. Hence b + c 2 + 2 b + c \leq 2 + 2 .

Calvin Lin Staff - 3 years, 2 months ago

Log in to reply

@Calvin Lin But why don't we take 1 as one of the integers!!!

erica phillips - 3 years, 2 months ago

Log in to reply

@Erica Phillips The integers could be 1 in some cases.
The step of "they are at most 2" holds even if "we take 1 as one of the integers".
The statement is the inequality b + c 2 + 2 b + c \leq 2 + 2 , not the equation b + c = 2 + 2 b + c = 2 + 2 .

Calvin Lin Staff - 3 years, 2 months ago

Log in to reply

@Calvin Lin Ok thanks!!!

erica phillips - 3 years, 2 months ago
Bill Weihmiller
Jun 22, 2018

No. '5 primes such that the sum of ANY three is also a prime.' The real problem is not picking the primes. The problem is 'sum of ANY three' still being prime, and that sum not being divisible by 3, specifically.

Let's build a set of 5 primes noting only their modulo, base 3. We'll pick: +1, +1, -1, -1. So far, okay. But now we're stuck. If we pick another +1, the three +1's added together form a number bigger than 3 with a modulo 3 = 0 so NOT prime. If we pick another -1, the three -1's have the same problem. So we try 3, itself, with modulo 0. Then the choice of a +1 and a -1 also lead to a number with modulo 0, but greater than 3, so not prime. So it doesn't matter how you goose the primes, the problem is you can't pick FIVE of them such that ANY three sum to a prime.

Sarthak Bansal
Mar 25, 2018

Well, there is one very simple restriction I can add. One of the primes in any set of 5 would be 2.

One of the 5 primes is 2. There must be cases involving (a+b) + 2, which always equals (even Number) plus 2 and is thus never divisible by 2.

Never divisible by 2?

pushkar sompurkar - 3 years, 2 months ago

Log in to reply

Ya what, doesn't this prove the opposite claim: "None of the primes can be 2?"

John Smith - 3 years, 2 months ago
Elias Lageder
Mar 23, 2018

If we add four prime numbers, our result will always be an even integer and thus not a prime number. However, there is one exception, which occurs when one of the chosen primes is 2. Hence, in order to make our result odd, 2 must be one of the primes. But, as we have to leave it out once in order to try every possible combination of the five numbers, the tim we leave it out, the result must necessarily be an even number and can't be prime.

The problem involves sums of three of the numbers, not four.

Paul Sherman - 3 years, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...