Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is a possible approach:

def all_two_squares(n):
    return [(abs(d[0]),abs(d[1])) for d in divisors(GaussianIntegers()(n)) if norm(d)==n]