Problem 47950. Test the generalized Legendre conjecture
The Legendre conjecture states that for every integer n there is a prime number between
and
. The generalized Legendre conjecture (GLC) is that there is a prime number between
and
; a further conjecture is that the smallest K possible is
.
Write a function that takes a value of K, which you can assume to be less than
, and determines the first value of n for which the GLC fails as well as the interval [
].
Solution Stats
Problem Comments
-
1 Comment
Hoang Minh Tri
on 12 Nov 2025
kho:))
Solution Comments
Show commentsProblem Recent Solvers31
Suggested Problems
-
Find common elements in matrix rows
2712 Solvers
-
Find the stride of the longest skip sequence
175 Solvers
-
Numbers with prime factors 2, 3 and 5.
680 Solvers
-
166 Solvers
-
Hexagonal numbers on a spiral matrix
164 Solvers
More from this Author316
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!