The mth prime
is classified as “good” if
for
. For example, 5 is a good prime because
is greater than
and
, but 7 is not because
.
Write a function to list the first n good primes.
Solution Stats
Problem Comments
4 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers18
Suggested Problems
-
Find the numeric mean of the prime numbers in a matrix.
9159 Solvers
-
How to find the position of an element in a vector without using the find function
2819 Solvers
-
Back to basics 21 - Matrix replicating
1816 Solvers
-
Get the elements of diagonal and antidiagonal for any m-by-n matrix
519 Solvers
-
Write a function man that takes a row vector v and returns a matrix H as follows..
651 Solvers
More from this Author326
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
In the description, k>=1
Thanks--fixed.
Why is 2 not a good prime? With m = 1, it trivially holds that p_m^2 > p_{m-k} p_{m+k} for all 1 \le k \le m-1 since this is in fact an empty statement then.
It's not included in the lists I've seen probably because there is no zeroth prime.