def compute():
	totients = eulerlib.list_totients(10**7 - 1)
	minnumer = 1
	mindenom = 0
	for (i, tot) in enumerate(totients[2 : ], 2):
		if i * mindenom < minnumer * tot and sorted(str(i)) == sorted(str(tot)):
			minnumer = i
			mindenom = totients[i]
	return str(minnumer)
Beispiel #2
0
def compute():
	totients = eulerlib.list_totients(10**7 - 1)
	minnumer = 1
	mindenom = 0
	for (i, tot) in enumerate(totients[2 : ], 2):
		if i * mindenom < minnumer * tot and sorted(str(i)) == sorted(str(tot)):
			minnumer = i
			mindenom = totients[i]
	return str(minnumer)
Beispiel #3
0
def compute():
    totients = eulerlib.list_totients(10**6)
    max = 0
    t = 2
    for i in range(2, len(totients)):
        if i / totients[i] > max:
            max = i / totients[i]
            t = i
    return t
Beispiel #4
0
def compute():
    totients = eulerlib.list_totients(10**6)
    ans = max(range(2, len(totients)),
              key=(lambda i: fractions.Fraction(i, totients[i])))
    return str(ans)
Beispiel #5
0
def compute():
	totients = eulerlib.list_totients(10**6)
	ans = sum(itertools.islice(totients, 2, None))
	return str(ans)
Beispiel #6
0
def compute():
    totients = eulerlib.list_totients(10**6)
    ans = sum(itertools.islice(totients, 2, None))
    return str(ans)
def compute():
	totients = eulerlib.list_totients(10**6)
	ans = max(range(2, len(totients)), key=(lambda i: fractions.Fraction(i, totients[i])))
	return str(ans)