Project Euler #2: Even Fibonacci numbers

  • + 1 comment

    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)