Problem 49783. List the good primes
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
Show
1 older comment
ChrisR
on 20 Dec 2021
Thanks--fixed.
Christian Schröder
on 25 Mar 2023
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.
ChrisR
on 28 Mar 2023
It's not included in the lists I've seen probably because there is no zeroth prime.
Solution Comments
Show commentsGroup

Prime Numbers II
- 19 Problems
- 7 Finishers
- List the delete-a-digit primes
- List the dihedral primes
- List the good primes
- Determine whether a number is a prime self number
- Compute home primes in a given base
- List Proth primes
- Label primes with the Erdos-Selfridge classification
- List Honaker primes
- List the nth prime quartet prefix
- Find the smallest prime with n inside
- List prime anagrams of a number
- Determine whether a number is unprimeable
- Count the primes in Collatz sequences
- Play Outside In with primes
- Identify prime words
- Find pairs of primes with the same digit sum and a specified separation
- List composite numbers that cannot be written as the sum of two primes
- Compute the arithmetic derivative of integers
- Solve the arithmetic differential equation D(n) = n
Problem Recent Solvers14
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!