How to generate prime numbers in LaTeX