# 见unsolved 找规律
N = 1000
FS = (15499,94744)
dstRadio = FS[0]/FS[1]
p = [0 for i in range(0, N+10)]

def init():
    p[1] = 1
    for i in range(2, N+1):
        if p[i] == 0:
            j = i*i
            while j <= N:
                p[j] = i
                j += i


def rc(val, arr, idx, der, pn):
    if idx == len(arr):
        return pn * (val // der)

    return rc(val, arr, idx+1, der, pn) + rc(val, arr, idx+1, der * arr[idx], pn * -1)


def main():
    curm = 2
    minRadio = 2
    arr = [2]
    for i in range(3,N+1):
        if p[i] != 0:
            continue;
        for j in range(1,i):
            ret = rc(curm * j, arr, 0, 1, 1)
            minRadio = min(minRadio,ret / (curm * j -1))
            print(f"{curm * j}/{N}, min radio:{minRadio}, dst radio:{dstRadio}")
            if ret * FS[1] < (curm * j -1) * FS[0]:
                print(f"{curm * j}:{ret}/{curm * j - 1}")
                return
        arr.append(i)
        curm *= i
    print("not found")


print("init start")
init()
print("init end")
main()






































