Exemplo n.º 1
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)
Exemplo n.º 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)
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 5
0
def compute():
	totients = eulerlib.list_totients(10**6)
	ans = sum(itertools.islice(totients, 2, None))
	return str(ans)
Exemplo n.º 6
0
def compute():
    totients = eulerlib.list_totients(10**6)
    ans = sum(itertools.islice(totients, 2, None))
    return str(ans)
Exemplo n.º 7
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)