With the help of sympy.lucas() method, we can find Lucas numbers in SymPy.
Lucas numbers satisfy a recurrence relation similar to that of the Fibonacci sequence, in which each term is the sum of the preceding two. They are generated by choosing the initial values and and the recurrence relation .
n – It denotes the number upto which lucus number is to be calculated.
Returns: Returns the nth lucas number.
Value of n = 7 Value of nth lucas number : 29
Value of n = 10 N lucas number are : [2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123]
- Difference between Method Overloading and Method Overriding in Python
- class method vs static method in Python
- Python | os.dup() method
- Python | set() method
- Python | next() method
- Python PIL | putpixel() method
- Python | sympy.csc() method
- Python | os.fstat() method
- Python PIL | getpixel() Method
- Python | os.unlink() method
- Python | os.kill() method
- Python | os.times() method
- Python PIL | Image.new() method
- PUT method - Python requests
- GET method - Python requests
- Python | PyTorch cos() method
- Python | PyTorch tan() method
- Python | cmath.exp() method
- Python | cmath.log() method
- Python | os.getrandom() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.