자연수를 순서대로 무한분수로 배열해서 √2 만들기
이게 뭔가 싶었는데, 계산해보니까 정말 된다. import numpy as npval = 1/2i = 2for _ in range(20): seq = np.arange(2**(i-1)+1, 2**i+1) while len(seq) > 1: seq = seq[0::2] / seq[1::2] val = val / seq[0] print(val**2) i += 1 0.44444444444444440.489999999999999940.49868007925621080.499882850334469830.499993414444249160.49999977495866860.499999995458441540.49999999994700980.49999999999964850.499999..
mathe
2024. 6. 25. 14:43