Leonardo numbers are defined by following recurrence relation:
Leonard prime is Leonardo number which is also prime (see https://en.wikipedia.org/wiki/Leonardo_number).
For given n, find all Leonardo primes.
Example:
n=5;
LeoNumbers=[1 1 3 5 9 15];
Primes=[2 3 5 7 11 13];
LeoPrimes=[3 5];
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers25
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
53955 Solvers
-
22583 Solvers
-
Remove the two elements next to NaN value
715 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
406 Solvers
-
78 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!