### Checking the Firoozbakht conjecture up to 1000000

Doing Math with JavaScript | Firoozbakht conjecture

The Firoozbakht conjecture:
Let pk be the k-th prime, then the sequence (pk)1/k is strictly decreasing.
Alternative formulation(pk)k+1 > (pk+1)k, where pk is the k-th prime.

Here is a check of the Firoozbakht conjecture for pk < 1000000:

```      k       p        p1/k       OK/fail  Alternative formulation:

function format5 (k) {
if (k<10) return '    '+k
if (k<100) return '   '+k
if (k<1000) return '  '+k
if (k<10000) return ' '+k
return k
}

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
}

primes = findPrimes(1000050)

function checkFiroozbakht(stop) {
var p, q=2,r0=100,r1=100;
for (var k=1; k<=stop; k++) {
p = primes[k-1]; q = primes[k];
r0 = r1;
r1 = Math.pow(p,1/k);
//document.writeln ( format7(k) +' '+format7(p) +' '+format5(r1.toFixed(9))+' '+(r1>=r0 ? 'FAILURE':'   OK  ') );
document.writeln ( format7(k)
+' '+format7(p) +' '+format5(r1.toFixed(9))+' '+(r1>=r0 ? 'FAILURE':'   OK  ')
+'   '+p+'<sup>'+(k+1)+'</sup>'+' > '+q+'<sup>'+k+'</sup>'
)
}
}

checkFiroozbakht(78500);

```