Skip to content

Instantly share code, notes, and snippets.

@igorvanloo
Created July 25, 2021 03:34
Show Gist options
  • Save igorvanloo/ada4f2a9c3f5e6f5c399defc47ff6ac7 to your computer and use it in GitHub Desktop.
Save igorvanloo/ada4f2a9c3f5e6f5c399defc47ff6ac7 to your computer and use it in GitHub Desktop.
Problem 46
def goldbachs(number):
for x in range(1, int(math.sqrt(number))+1):
temp_var = number - 2*(x**2)
if is_prime(temp_var) == True:
return True
return False
def compute():
count = 33
while True:
if is_prime(count):
count += 2
else:
if goldbachs(count):
count += 2
else:
return count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment