Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from decimal import Decimal
- import math
- import numpy as np
- def fibgen(n):
- y = math.sqrt(5)
- x = Decimal((1+Decimal(y))**n-(1-Decimal(y))**n)//Decimal(2**n*Decimal(y))
- print(x)
- return x
- n=5000
- while True:
- if(int(math.log10(fibgen(n))+1) == 1000):
- print(n)
- break
- n += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement