Sage Quadratic Residue, Bases: sage.