Compute the norm and discriminant of an ideal in a given algebraic integer ring

Let $K = \mathbb{Q}(i)$ and $\mathcal{O} = \mathbb{Z}[i]$. Let $A = (2)$ and $B = (2+i)$ be ideals in $\mathcal{O}$. For $I \in \{A,B\}$, find a basis for $I$ and compute the discriminant and norm of $I$. Compute $\mathcal{O}/I$.

We claim that $\{2,2i\}$ is a basis for $A$ over $\mathbb{Z}$. Indeed it is clear that $(2,2i)_\mathbb{Z} = (2)$, and if $2a+2bi = 0$, then $a = b = 0$. Then the discriminant of $A$ is $\mathsf{det}^2 \left[ \begin{array}{cc} 2 & 2i \\ 2 & -2i \end{array} \right] = -64$ and (using Theorem 9.10 in TAN) $N(A) = -4$.

Let $a + bi \in \mathcal{O}$ be arbitrary, and say $a \equiv a_0$ and $b \equiv b_0$ mod 2, where $a_0,b_0 \in \{0,1\}$. Certainly $a+bi \equiv a_0+b_0i$ mod $A$, so that $\mathcal{O}/A = \{\overline{0}, \overline{1}, \overline{i}, \overline{1+i}\}$. Since $N(A) = 4$, we know that these cosets are distinct.

We claim now that $\{2+i,1-2i\}$ is a basis for $B$ over $\mathbb{Z}$. Indeed, note that $1-2i = -i(2+i) \in B$, and if $\zeta = (2+i)(a+bi) \in B$, then $zeta = a(2+i) - b(1-2i)$. Moreover, if $a(2+i) + b(1-2i) = 0$, then $2a+b = a-2b = 0$, so that $5b = 0$, and thus $b = a = 0$. Then the discriminant of $B$ is $\mathsf{det}^2 \left[ \begin{array}{cc} 2+i & 1-2i \\ 2-i & 1+2i \end{array} \right] = -100$ and the norm of $B$ is $N(B) = 5$.

Note that $N(2+i) = 5 \in B$. If $a+bi \in \mathcal{O}$ is arbitrary, then $a+bi = a-2b + b(2-i) \equiv a-2b$ mod $B$. If $a-2b \equiv k$ mod 5, with $k \in \{0,1,2,3,4\}$, then $a+bi \equiv k$ mod $B$. Thus $\mathcal{O}/B = \{\overline{0},\overline{1},\overline{2},\overline{3},\overline{4}\}$. Since $N(B) = 5$, these cosets are distinct.