text1: On what theorem is the formula that frequently generates the number 2 and all other primes precisely once based on?
text2: Another formula is based on Wilson's theorem and generates the number 2 many times and all other primes exactly once.