N-smooth numbers: Difference between revisions

Line 624:
return false if n.gcd(6) != 1 # 1/3 of integers are P3 pc
pc = typeof(n).new(5) # first P3 prime candidates sequence value
until pc*pc > sqrtNn
sqrtN = typeof(n).new(Math.sqrt(n))
until pc > sqrtN
return false if n % pc == 0 || n % (pc + 2) == 0 # if n is composite
pc += 6 # 1st prime candidate for next residues group
Anonymous user