intror2:= function(n) local r, x, i; x:= []; i:= 1; Print("The solutions to x^2 = -1 in Z_", n, " are "); r:= Elements(Integers mod n); repeat if Int(r[i]^2) = n-1 then Add(x,r[i]); fi; i:= i+1; until i=n+1; return x; end;