Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N = int(input("value of N: "))
- fibo = [0,1]
- sequence = [1,2]
- i = 1
- if N == 2 :
- print(sequence)
- elif N == 1:
- print (sequence[0])
- while(sequence[i] < N):
- i += 1
- fibo.append(fibo[i - 1] + fibo[i - 2])
- sequence.append(sequence[i-1] + fibo[i]**2)
- print(sequence)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement