We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Bro you and Dan Brown made it possible for me to solve this problem. Only test case 3 is always returning wrong. Can you help me? (Note: I am new to programming, sorry for any noobish mistake)
golden = (1 + 5 ** 0.5) / 2
phi3 = golden**3
T = int(input().strip())
for i in range(T):
N = int(input().strip())
n = 2
sum = 0
while n < N:
sum += n
n = int(phi3 * n + 0.5)
print(sum)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #2: Even Fibonacci numbers
You are viewing a single comment's thread. Return to all comments →
Bro you and Dan Brown made it possible for me to solve this problem. Only test case 3 is always returning wrong. Can you help me? (Note: I am new to programming, sorry for any noobish mistake)