Is the NetBSD primes utility (or equivalent) available on MacOS in any package, other than via manual download-and-compile (e.g. curl)? I searched quite a lot and couldn't find any package (other than the NetBSD CVS source).
primes is not a prime-sieve to find large/as-yet-unknown primes, just a simple command-line utility which tells you which integers are prime (or composite) in a given (64b) range).
factor which is available via package coreutils "Finding Prime Numbers - “factor” command not found on MacOS", "Is there a practical use for the GNU factor command?")
Note: this question does not belong on AskDifferent since there is no brew/macports package.