Improved runtime

- Finished in 50.7 seconds
- 24 examples, 0 failures
Runs in O(sqrt N) instead of O(N)

- Finished in 0.00576 seconds
- 24 examples, 0 failures