(p)
return sorted(list(r))
Returns the list of quadratic residues.

    Examples
    ========

    >>> from sympy.ntheory.residue_ntheory import quadratic_residues
    >>> quadratic_residues(7)
    [0, 1, 2, 4]
Returns the list of quadratic residues.
Returns the list of quadratic residues .
def quadratic_residues(p):
    """
    Returns the list of quadratic residues.

    Examples
    ========

    >>> from sympy.ntheory.residue_ntheory import quadratic_residues
    >>> quadratic_residues(7)
    [0, 1, 2, 4]
    """
    r = set()
    for i in xrange(p // 2 + 1):
        r.add(pow(i, 2, p))
    return sorted(list(r))
def quadratic_residues ( p ) : r = set ( ) for i in xrange ( p // 2 + 1 ) : r . add ( pow ( i , 2 , p ) ) return sorted ( list ( r ) )