### Generalized Legendre Conjecture: a partial computational verification

Here is a computational check of the following special cases of the generalized Legendre conjecture:

The n5/3 conjecture. For each positive integer n, there is a prime between n5/3 and (n+1)5/3.
The n8/5 conjecture. For each positive integer n, there is a prime between n8/5 and (n+1)8/5.
The n3/2 conjecture. For each integer n > 1051, there is a prime between n3/2 and (n+1)3/2.

The computation strongly suggests (but does not prove) that the n5/3 and n8/5 conjectures hold for all positive n, while the n3/2 conjecture fails for n = 10, 20, 24, 27, 32, 65, 121, 139, 141, 187, 306, 321, 348, 1006, and 1051. Additional checks for the first ten million values of n do not yield any other counterexamples. We observe that, as n grows larger, prime gaps become relatively smaller and smaller, as compared to the intervals [ns, (n+1)s] – in other words, although prime gaps do grow, the width of intervals [ns, (n+1)s] grows even faster. This makes additional counterexamples extremely unlikely for very large n.

```      n       n5/3  < prime  < (n+1)5/3  OK/fail      n8/5  < prime  < (n+1)8/5  OK/fail    n3/2  <  prime  < (n+1)3/2 OK/fail

function format7 (k) {
if (k<10) return '      '+k
if (k<100) return '     '+k
if (k<1000) return '    '+k
if (k<10000) return '   '+k
if (k<100000) return '  '+k
if (k<1000000) return ' '+k
return k
}

pwr = 5/3;
pw2 = 8/5;
pw3 = 3/2;

// all results
function showAll(start) {
var stop = start + 10000;
var npow = 1, mpow = Math.pow(start,pwr);
var npw2 = 1, mpw2 = Math.pow(start,pw2);
var npw3 = 1, mpw3 = Math.pow(start,pw3);
for (var n=start; n<stop; n++) {
npow = mpow;
npw2 = mpw2;
npw3 = mpw3;
mpow = Math.pow(n+1,pwr);
mpw2 = Math.pow(n+1,pw2);
mpw3 = Math.pow(n+1,pw3);
p = nextPrime(npow);
p2= nextPrime(npw2);
p3= nextPrime(npw3);
document.writeln ( format7(n)
+' '+format7(npow.toFixed(2))+' '+format7(p) +' '+format7(mpow.toFixed(2))+' '+(p >=mpow?' FAILED':'   OK  ')
+' '+format7(npw2.toFixed(2))+' '+format7(p2)+' '+format7(mpw2.toFixed(2))+' '+(p2>=mpw2?' FAILED':'   OK  ')
+' '+format7(npw3.toFixed(2))+' '+format7(p3)+' '+format7(mpw3.toFixed(2))+' '+(p3>=mpw3?' FAILED':'   OK  ')
)
}
}

function showFailures(start) {
var stop = start + 10000;
var npow = 1, mpow = Math.pow(start,pwr);
var npw2 = 1, mpw2 = Math.pow(start,pw2);
var npw3 = 1, mpw3 = Math.pow(start,pw3);
for (var n=start; n<stop; n++) {
npow = mpow;
npw2 = mpw2;
npw3 = mpw3;
mpow = Math.pow(n+1,pwr);
mpw2 = Math.pow(n+1,pw2);
mpw3 = Math.pow(n+1,pw3);
p = nextPrime(npow);
p2= nextPrime(npw2);
p3= nextPrime(npw3);
if (p>=mpow || p2>=mpw2 || p3>=mpw3)
document.writeln ( format7(n)
+' '+format7(npow.toFixed(2))+' '+format7(p) +' '+format7(mpow.toFixed(2))+' '+(p >=mpow?' FAILED':'   OK  ')
+' '+format7(npw2.toFixed(2))+' '+format7(p2)+' '+format7(mpw2.toFixed(2))+' '+(p2>=mpw2?' FAILED':'   OK  ')
+' '+format7(npw3.toFixed(2))+' '+format7(p3)+' '+format7(mpw3.toFixed(2))+' '+(p3>=mpw3?' FAILED':'   OK  ')
)
}
}

showAll(1);
//showFailures();

```