Look for factors only up to sqrt + 1 by hectormonacci · Pull Request #6 · andrewrk/zig-async-demo
No need to keep searching for factors among lower prime numbers once you reach the square root (plus 1) of the number you are testing for primality. If you get there, you can safely quit the search...
github.com