Blue Bridge Cup python group - both approximate fractions

Blue Bridge Cup python group - both approximate fractionsinsert image description here

import os
import sys
import math #math.gcd()方法 它接受两个整数并返回其最大公约数
count = 0
for i in range(1,2021):
    for j in range(1,2021):
        if math.gcd(i,j) == 1:
        	#print("{}/{}".format(i,j))
            count += 1
print(count)

The answer is 2481215
Thank you for your support. Your one-click three-connection is the biggest driving force for Ganggang students!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324322647&siteId=291194637