Anonymous user
Ramanujan primes: Difference between revisions
Some modifications in function "ramanujanPrime".
(→{{header|Phix}}: replaced with faster version) |
(Some modifications in function "ramanujanPrime".) |
||
Line 410:
proc ramanujanPrime(pi: PrimeCounter; n: int): int =
var max = ramanujanMax(n)
if (max and 1) == 1: dec max
for i in countdown(
if pi[i] - pi[i div 2] < n:
return i + 1
|