Isolation and loneliness
#!/usr/bin/env python from fractions import gcd N = 1000000 for d in xrange(2, N): for n in xrange(3*d/7+1, 1, -1): if n*7 < 3*d: if gcd(n,d) == 1: res = (n, d) break; print(res)
Aucun commentaire:
Enregistrer un commentaire