Test the generalized Legendre conjecture - MATLAB Cody - MATLAB Central

Problem 47950. Test the generalized Legendre conjecture

Difficulty:Rate
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
Primes and Rough Numbers, Basic ideas
What is a rough number? What can they be used...
2
4

Problem Recent Solvers14

Suggested Problems

More from this Author291

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page