Fixed get_prime_array and pre-generate prime format