As of datenum 738289, three of the twenty largest known prime numbers are Proth primes, prime numbers of the form
with
. For example, taking
and
gives 3, the first Proth prime, and taking
and
gives 97, the sixth Proth prime. The number 199 is prime but not a Proth prime because
. The number 49 is a Proth number (
,
) but not prime.
Write a function to list the Proth primes between two limits a and b. Also provide the values of k and m.
Optional: Values of k for which no values of
are prime are called Sierpinski numbers. Show that 78,557 is the smallest Sierpinski number. For more, see this page.
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers13
Suggested Problems
-
10776 Solvers
-
Longest run of consecutive numbers
6606 Solvers
-
562 Solvers
-
562 Solvers
-
Implement a bubble sort technique and output the number of swaps required
395 Solvers
More from this Author323
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Chris, what if there are multiple pairs of (k,m) that result in a particular proth number, which pair should we report?
For example -
k=4, m=2, p=17
k=2, m=3, p=17
k=1, m=4, p=17
also
k=1, m=2, p=5
k=2, m=1, p=5
Good question, Dyuman. Please use the largest m possible.
Thanks for the clarification, Chris.
Nice question!