We define $\mathbb{Z}[i] := \{a + bi \mid a, b \in \mathbb{Z}\}, i = \sqrt{-1},$ which is an euclidean ring together with $N: \mathbb{Z}[i] \to \mathbb{N}_0, z \mapsto z\bar{z}=a^2+b^2$ for $z=a+bi$. Being an euclidean ring means also to be a factorial ring so that each element $z \in \mathbb{Z}[i]$ can be decomposed into a product of prime elements.
Given an exercise to decompose $4 + 12i$ into prime factors in $\mathbb{Z}[i]$ I spent a lot of time just bruteforcing the combinations. Then I got $$4+12i = 4(1 + 3i) = 2^2(-1 + i)(1-2i) = (1+i)^2(1-i)^2(-1+i)(1-2i),$$ which also was the intended solution. There is also a theorem that states that if $N(z)$ is a prime in $\mathbb{Z}$, then $z$ is irreducible in $\mathbb{Z}[i]$, hence it is a prime element in $\mathbb{Z}[i]$. That verifies that all factors on the right side of the solution are prime.
As bruteforce is never effective, scalable and good for ones' karma I asked myself if there is a more effective way to compute this decomposition.
Are you aware of any procedure that brings some insights into the decomposition and makes it more effective?