Taking $p$ and $q$ to be the same value in paillier cryptosystem
Irrespective of the math, you CANNOT take $p=q$ since in this case the scheme is completely insecure. You must choose random, independent primes $p$ and $q$.