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 Padovan
- # Licenciado bajo GNU's Not Unix General Public Licence (GNU GPL) versión 3
- def Pado(x):
- acum = a = 0
- b = c = 1
- for i in range(1,abs(x)):
- acum = a + b
- a = b
- b = c
- c = acum
- return acum
- print(Pado(int(input("Ingrese un número natural: "))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement