Lucas Sequence
The script prints numbers of the Lucas Sequence on the command line or just the last number given the number if iterations.
This script is ready to use script which uses three arguments. The
arguments determine the values for
Function prints numbers divided by a space character.
Invoking the script runs this function.
Function prints numbers divided by a space character and the time taken for the calculation.
Function prints the last number in the sequence.
Function prints the last number in the sequence and the time taken for the calculation.
This script require the time, math, sys and doctest package.
$ git clone https://github.com/StokicDusan/LucasSequence
$ cd LucasSequence/
In the command line simply invoke the script with three arguments:
$ python lucasSequence.py argv1 argv2 argv3
- argv1, argv2:
Any integer - argv3:
Any positive integer
Invoking the script with no or less arguments will run testmod().
The following code block shows examples of calling the lucasSequence script from terminal.
$ python3 lucasSequence.py 0 0 6
0 0 0 0 0 0
$ python3 lucasSequence.py 2 1 10
2 1 3 4 7 11 18 29 47 76
$ python3 lucasSequence.py 1 1 12
1 1 2 3 5 8 13 21 34 55 89 144
$ python3 lucasSequence.py 2308 4261 5
2308 4261 6569 10830 17399
$ python3 lucasSequence.py 5 -20 4
5 -20 -15 -35
If you encounter any bugs or have suggestions, please file an issue in the Issues section of the project.