Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions GoldbachConjecture.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ def Goldbach(n):
findPrimes(n)
GoldbachNumbers[n] = []
for i in primes:
if i > n/2:
break
if n - i in primes:
if i > (n/2):
break
if (n - i) in primes:
GoldbachNumbers[n].extend([i, n - i])

# Find the prime possibilities for all numbers up to N
Expand Down Expand Up @@ -59,8 +59,7 @@ def findGoldbachs(n):
# I/O loop
x = 2
while x > 0:
x = int(input('Enter an even number: '))
# x = 10000
x = int(input('Enter an even number: ')
findGoldbachs(x)
print(GoldbachNumbers[x])

Expand Down