Template library for prime numbers generation