§ How ideals recover factorization [TODO ]

This was generated from the python code:
class algnum:
    def __init__(self, a, b):
        self.a = a
        self.b = b
    def __add__(self, other):
        return algnum(self.a + other.a, self.b + other.b)
    def __mul__(self, other):
        # (a + b \sqrt(-5)) (a' + b' \sqrt(-5))
        # aa' + ab' sqrt(-5) + ba' sqrt(-5) + bb' (- 5)
        # aa' - 5 bb' + sqrt(-5)(+ab' +ba')
        return (self.a * other.b - 5 * self.b * other.b,
                self.a * other.b + self.b * other.a)
    def __str__(self):
        if self.b == 0:
            return str(self.a)
        if self.a == 0:
            return f"{self.b}sqrt(-5)"
        return f"[{self.a}, {self.b} sqrt(-5)]"

    def normsq(self):
        # (a + b \sqrt(-5))(a - b \sqrt(-5))
        # = a^2 - (-5) b^2
        # = a^2 + 5 b^2
        return self.a * self.a + 5 * self.b * self.b
    def is_zero(self):
        return self.a == 0 and self.b == 0
    def is_one(self):
        return self.a == 1 and self.b == 0

    def is_minus_one(self):
        return self.a == -1 and self.b == 0



    __repr__ = __str__

nums = [algnum(a, b) for a in range(-10, 10) for b in range(-10, 10)]

def divisor_candidates(p):
    return [n for n in nums if n.normsq() < p.normsq() \
                  and not n.is_zero() \
                  and not n.is_one() \
                  and not n.is_minus_one()]

# recursive.
print("normsq of 2: ", algnum(2, 0).normsq());
print("normsq of 3: ", algnum(3, 0).normsq());
print("normsq of 1 + sqrt(-5):" , algnum(1, 1).normsq());
print("potential divisors of 2: ", divisor_candidates(algnum(2, 0)))
# candidates must be real. Only real candidate is 2.
print("potential divisors of 3: ", divisor_candidates(algnum(3, 0)))
# Candidate must be mixed.
print("potential divisors of (1 + sqrt(-5)): ", divisor_candidates(algnum(1, 1)))
print("potential divisors of (1 - sqrt(-5)): ", divisor_candidates(algnum(1, -1)))

§ Recovering unique factorization of ideals