Completed and tested solution with Eratostene's siege.