n = int(input())soma = 0 for i in range(n): soma += (i+1)/(n-i) print(n, soma)
10
10 22.218650793650795
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!