find a dynamic way to get the n prime number