We find by elementary methods the number of solutions of the equation RX2 + SY2 ≡ 1 (mod N), where N is an RSA composite and R, S are given integers coprime to N. When S (or R) is a square modulo N and its square root is known, our approach gives a very simple randomized algorithm for finding a solution. We also find the number of solutions in terms of Legendre and Jacobi symbols.