Key questions in number theory involve the distribution of prime numbers. For example, the Twin Prime Conjecture states that infinitely many twin primes, or two primes separated by 2, exist. This conjecture has not been proved, and progress is addressed in an interesting video from Numberphile.
This problem deals with the most common gap between primes up to a given number. John Conway dubbed this gap the jumping champion. For numbers up to 20, the jumping champion is 2 because it occurs four times (between 3 and 5, 5 and 7, 11 and 13, and 17 and 19.)
To me, the jumping champion is somewhat disappointing because 6 dominates until about 1.74
. Therefore, I will coin another term: the jumping medalists, or the three most common gaps between primes up to a given number. For numbers up to 20, the gold, silver, and bronze jumping medals (i.e., first, second, and third place) go to 2, 4, and 1, respectively.
Write a function that determines the jumping medalists as well as the maximum gap. Award the medals as in Cody Problem 46576 and return an empty vector for any medal that cannot be awarded.
Solution Stats
Problem Comments
3 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers19
Suggested Problems
-
Select every other element of a vector
36047 Solvers
-
14060 Solvers
-
789 Solvers
-
473 Solvers
-
Back to basics - mean of corner elements of a matrix
459 Solvers
More from this Author321
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
In test6 with n=100, J3=1 no ?
Jean-Marie, in Test 6, three medals (1 gold, 2 silver) have already been awarded. By the rules from Cody Problem 46576, no bronze is awarded.
OK.
Thanks.