Prime finder algorithm implemented for C++ module.