Problem 47950. Test the generalized Legendre conjecture

The Legendre conjecture states that for every integer n there is a prime number between n^2 and (n+1)^2. The generalized Legendre conjecture (GLC) is that there is a prime number between n^K and (n+1)^K; a further conjecture is that the smallest K possible is log(1151)/log(95).
Write a function that takes a value of K, which you can assume to be less than log(1151)/log(95), and determines the first value of n for which the GLC fails as well as the interval [n^K (n+1)^K].

Solution Stats

51.85% Correct | 48.15% Incorrect
Last Solution submitted on Sep 09, 2024

Solution Comments

Show comments

Problem Recent Solvers14

Suggested Problems

More from this Author281

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!