The Lucas sequence follows the same additive rule as Fibonacci, but starts with 2 and 1. Sequence: 2, 1, 3, 4, 7, 11, 18, 29, 47, ...
Write a function that returns the first n numbers of the Lucas sequence.
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers4
Suggested Problems
-
4 Solvers
More from this Author30
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
When testing whether an array is empty, it's better to use isempty() than to compare to [].