Goldbach in 2016

How many distinct pairs of prime numbers sum to 2016?

Note : This problem is best done with the aid of a computer. The search is a bit tedious to do by hand.


The answer is 73.

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.

2 solutions

Andy Hayes
Sep 26, 2016

The pairs are:

5 2011 13 2003 17 1999 19 1997 23 1993 29 1987 37 1979 43 1973 67 1949 83 1933 103 1913 109 1907 127 1889 137 1879 139 1877 149 1867 193 1823 227 1789 229 1787 233 1783 239 1777 257 1759 263 1753 269 1747 283 1733 293 1723 307 1709 317 1699 347 1669 349 1667 353 1663 359 1657 379 1637 389 1627 397 1619 409 1607 419 1597 433 1583 449 1567 457 1559 463 1553 467 1549 523 1493 557 1459 563 1453 569 1447 577 1439 587 1429 593 1423 607 1409 617 1399 643 1373 709 1307 719 1297 727 1289 733 1283 739 1277 757 1259 787 1229 823 1193 829 1187 853 1163 863 1153 887 1129 907 1109 919 1097 929 1087 947 1069 953 1063 967 1049 977 1039 983 1033 997 1019 \begin{array}{cc} 5 & 2011 \\ 13 & 2003 \\ 17 & 1999 \\ 19 & 1997 \\ 23 & 1993 \\ 29 & 1987 \\ 37 & 1979 \\ 43 & 1973 \\ 67 & 1949 \\ 83 & 1933 \\ 103 & 1913 \\ 109 & 1907 \\ 127 & 1889 \\ 137 & 1879 \\ 139 & 1877 \\ 149 & 1867 \\ 193 & 1823 \\ 227 & 1789 \\ 229 & 1787 \\ 233 & 1783 \\ 239 & 1777 \\ 257 & 1759 \\ 263 & 1753 \\ 269 & 1747 \\ 283 & 1733 \\ 293 & 1723 \\ 307 & 1709 \\ 317 & 1699 \\ 347 & 1669 \\ 349 & 1667 \\ 353 & 1663 \\ 359 & 1657 \\ 379 & 1637 \\ 389 & 1627 \\ 397 & 1619 \\ 409 & 1607 \\ 419 & 1597 \\ 433 & 1583 \\ 449 & 1567 \\ 457 & 1559 \\ 463 & 1553 \\ 467 & 1549 \\ 523 & 1493 \\ 557 & 1459 \\ 563 & 1453 \\ 569 & 1447 \\ 577 & 1439 \\ 587 & 1429 \\ 593 & 1423 \\ 607 & 1409 \\ 617 & 1399 \\ 643 & 1373 \\ 709 & 1307 \\ 719 & 1297 \\ 727 & 1289 \\ 733 & 1283 \\ 739 & 1277 \\ 757 & 1259 \\ 787 & 1229 \\ 823 & 1193 \\ 829 & 1187 \\ 853 & 1163 \\ 863 & 1153 \\ 887 & 1129 \\ 907 & 1109 \\ 919 & 1097 \\ 929 & 1087 \\ 947 & 1069 \\ 953 & 1063 \\ 967 & 1049 \\ 977 & 1039 \\ 983 & 1033 \\ 997 & 1019 \end{array}

Daria Zafote
Aug 14, 2018
 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
#Goldbach’s conjecture:

#prime number checker
def prime(a):
    return not any(a%i==0 for i in range(2,int(a**0.5)+1)) and not a<=1

#sum finder
def sums(n):
    l,u=[],1
    for k in range(1,n+1):
        if prime(k):
            l+=[k]
    for i in range(len(l)):
        for j in range(i,len(l)):
            if l[i]+l[j]==n:
                print(str(u)+". ",l[i],"+",l[j])
                u+=1

#main
n=2016
print(n,"=")
sums(n)

#Copy and paste in Brilliant’s coding environment.
#Replace 2016 with an even number of your choice or int(input()). 

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...