Ramanujan primes: Difference between revisions

Content added Content deleted
(Some modifications in function "ramanujanPrime".)
(Added missing test in previous modification.)
Line 410: Line 410:


proc ramanujanPrime(pi: PrimeCounter; n: int): int =
proc ramanujanPrime(pi: PrimeCounter; n: int): int =
if n == 1: return 2
var max = ramanujanMax(n)
var max = ramanujanMax(n)
if (max and 1) == 1: dec max
if (max and 1) == 1: dec max