def approx_phi(n): x = 1 for k in range(n): x = 1/x x += 1 return x