Skip to content

Instantly share code, notes, and snippets.

@Hainish
Created September 15, 2016 07:21
Show Gist options
  • Save Hainish/26fd1060a244ccdeed830c5fbe198b4d to your computer and use it in GitHub Desktop.
Save Hainish/26fd1060a244ccdeed830c5fbe198b4d to your computer and use it in GitHub Desktop.
Proof that 16 is an Erdős-Woods number
from fractions import gcd
k = 16
a = 0
while True:
ew = True
for i in xrange(a+1, a+k):
if gcd(i, a) == 1 and gcd(i, a+k) == 1:
ew = False
if ew == True:
print "Erdos Number:", k
print "Proof:", a
break
a += 1
@Graystripe17
Copy link

Nice one bro. I made a fork to calculate more but idk when to stop checking for a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment