def sum(n): result = 0 for i in range(1,n+1,2): result = result + (1/i) return result n = int(input("请输入一个奇数:")) print(sum(n))