They will be algebraic integers, since the square root of an algebraic
integer is an algebraic integers.
But of course you really mean "a quadratic algebraic integer whose
characteristic polynomial has
discriminant that is a square time 5".
> Maybe there is a better way to do this. I'm going to walk away from my
> computer for a few minutes and hope that when I get back someone will have
> come up with a better solution.
I think your solution sounds pretty good, and it reminds me of what
one does with integers. It should be possible to code it so it is
reasonably fast.
-- William
--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
Does anyone know a good way to determine if an element of Q(sqrt 5) is a square? I'm rewriting some of my code in cython, and simply checking (using sage) if something is a square is taking roughly 1000000% of the time it takes to run my code.
Currently sage constructs a quadratic polynomial over K and tries to factor it. (I'm sure I can get a 50% speedup in my case by simply checking first to see if the norm is positive.)