Skip to content

Instantly share code, notes, and snippets.

@mrklein
Created May 18, 2012 17:18
Show Gist options
  • Save mrklein/2726518 to your computer and use it in GitHub Desktop.
Save mrklein/2726518 to your computer and use it in GitHub Desktop.
Project Euler #73
#!/usr/bin/env python
from fractions import gcd
s = 4
e = 12001
nf = 0
for d in xrange(s, e):
for n in xrange(d/3 - 1, d/2 + 1):
if d < 3*n and 2*n < d:
if gcd(n, d) == 1:
nf += 1
print(nf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment