Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Este programa en python calcula el n-ésimo término de la suceśión de Fibonacci
- # Licenciado bajo GNU's Not Unix General Public Licence (GNU GPL) versión 3
- import math
- def Fibo(n):
- return (pow((1.0+math.sqrt(5))/2.0,abs(n))-pow((1.0-(1.0+math.sqrt(5))/2.0),abs(n)))/math.sqrt(5.0);
- print(math.floor(Fibo(int(input("Ingrese un número natural: ")))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement