Inspired by the need to solve many of the problems pertaining to prime numbers I have developed a suite of prime number generating utility methods. In April 2015 I released them as a Rubygem named primes-utils that can be installed easily in Ruby. In December 2015 I released its PRIME-UTILS HANDBOOK: The Math and Code behind making the Rubygem, which I continually update as I release new versions.
You can see the Rubygem here: https://rubygems.org/gems/primes-utils
The HANDBOOK is available FREE to read and download from my scribd.com page:
https://www.scribd.com/doc/266461408/Pr ... s-Handbook
I'm using techniques I developed myself, which are very fast, and use short and efficient code.
The methods should be easily translatable into other languages without a lot of problems.
Hopefully they might be useful for others.