Prime decomposition: Difference between revisions

→‎Python: Using Croft Spiral sieve: make croft() another ~2% faster (all measuring done with Python 3.11.1 and the first million primes)
m (→‎{{header|Phix}}: minor tidy)
(→‎Python: Using Croft Spiral sieve: make croft() another ~2% faster (all measuring done with Python 3.11.1 and the first million primes))
Line 4,079:
# Iterate over prime candidates 7, 11, 13, 17, ...
q += x
# Using dict membership testing instead of pop gives a
# 5-10% speedup over the first three million primes.
if q in roots:
p = roots[.pop(q])
del roots[q]
p2 = p + p
x = q + p2
559

edits