Can anyone help me understand how to find nth catalan number mod a prime number? I found this but am not able to understand it. (the last solution posted by Ben Voigt)

I am lost at the line

*Use the Sieve of Eratosthenes to find and store pairs of factors for all composite number *

sieve

What does it mean and how to find it? I couldn’t make out this part in the code provided there

P.S. I understand the approach. Just not the implementations.

Thanks