You are viewing a single comment's thread. Return to all comments →
100 points. Python 3
n=int(input().strip()) numerators=[1] denominators=[2] i=2 while i<=n: numerators.append(denominators[-1]) denominators.append(denominators[-1]*2+numerators[-2]) i+=1 for i in range(n): n=denominators[i]+numerators[i] d=denominators[i] if len(str(n))>len(str(d)): print(i+1)
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #57: Square root convergents
You are viewing a single comment's thread. Return to all comments →
100 points. Python 3