vendredi 1 juillet 2011

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)
view raw 73.py hosted with ❤ by GitHub

Aucun commentaire:

Enregistrer un commentaire