Group of Square Roots of Unity Modulo n

Let n ≥ 3 be an integer and G2(n) be the subgroup of square roots of 1 in (Z/nZ)*. In this paper, we give an algorithm that computes a generating set of this subgroup.




References:
[1] J-P. Serre, A Course in Arithmetic. Graduate Texts in Mathematics,
Springer, 1996
[2] S. Lang, Undergraduate Algebra, 2nd ed. UTM. Springer Verlag,1990
[3] H. Cohen, A course in computational algebraic number theory.
Springer-Verlag, 1993.
[4] V. Shoup, A Computational Introduction to Number Theory and Algebra.
Cambridge University Press, 2005.
[5] David M. Bressoud, Factorization and Primality Testing. Undergraduate
Texts in Mathematics, Springer-Verlag, New York, 1989.
[6] E. Bach, A note on square roots in finite fields. IEEE Trans. Inform.
Theory, 36(6):1494-1498, 1990. Eric
[7] E. Bach and K. Huber, Note on taking square-roots modulo N. IEEE
Transactions on Information Theory, 45(2):807809, 1999.
[8] D. Shanks, Five number-theoretic algorithms. In Proc. Second
Munitoba Conf. Numerical Math. 51-70, 1972.
[9] Hardy, G. H, Ramanujan: Twelve Lectures on Subjects Suggested by His
Life and Work, 3rd ed. New York: Chelsea, 1999. G. H.
[10] Hardy and E. M.Wright, An introduction to the theory of numbers,
4th ed. Oxford University Press, 1960.