A010380 Squares mod 18.
0, 1, 4, 7, 9, 10, 13, 16
Offset: 1
Programs
-
Mathematica
Union[PowerMod[Range[18], 2, 18]] (* Alonso del Arte, Dec 18 2019 *)
-
Sage
[quadratic_residues(18)] # Zerinvary Lajos, May 24 2009
-
Scala
(1 to 18).map(n => (n * n) % 18).toSet.toSeq.sorted // Alonso del Arte, Dec 18 2019