Let $n$ be an integer. There is a well-known formula for $\phi (n)$, where $\phi$ is the Euler phi function (totient). Essentially, $\phi(n)$ gives the number of invertible elements in $\mathbb{Z}/n\mathbb{Z}$.
Since Dedekind domains have the same factorization theorem for ideals analogous to that of the integers, one can define a generalized Euler phi function for an ideal $I$ of a Dedekind domain $R$, i.e. $\phi(I)$ gives the number of invertible elements of the factor ring $R/I$.
Moreover, $I$ factors uniquely into the product $$I=P_1^{r_1}P_2^{r_2}\ldots P_k^{r_k}$$ with $P_i$ prime, distinct. By the Chinese remainder theorem, $R/I$ is isomorphic to the product of the $k$ rings $R/P_k^{r_k}$. Therefore $\phi$ is multiplicative. Hence it suffices to consider the case $I=P^n$, $P$ prime, non-zero. Here my first problem: what is the number of invertible elements in $R/P^n$? Imitating the case $R=\mathbb{Z}$, it should be $\phi(P^n)=q^{n-1}(q-1)$, where $q$ is the cardinality of $R/P$, but i've not a proof of this.
Consider this example. Let $K=\mathbb{Q}[i]$ be a quadratic number field and $R=\mathscr{O}_k$ its ring of algebraic integers. We know that $\mathscr{O}_K=\mathbb{Z}[i]$. For every ideal $I$ of $\mathscr{O}_K$, put $\phi_K(I)$ equal to the number of invertible elements of the factor ring $\mathscr{O}_K/I$. I want to compute $$\phi(6630\mathscr{O}_K)$$ where $6630\mathscr{O}_K$ is the ideal generated by $6630$ in the extension ring $\mathscr{O}_K$ of $\mathbb{Z}$. This is what i did:
prime factorization: $6630=2\cdot3\cdot5\cdot13\cdot17$;
$2\mathscr{O}_K=(1+i)\mathscr{O}_K(1-i)\mathscr{O}_K$;
$3\mathscr{O}_K=3\mathscr{O}_K$;
$5\mathscr{O}_K=(1+2i)\mathscr{O}_K(1-2i)\mathscr{O}_K$;
$13\mathscr{O}_K=(3+2i)\mathscr{O}_K(3-2i)\mathscr{O}_K$;
$17\mathscr{O}_K=(1+4i)\mathscr{O}_K(1-4i)\mathscr{O}_K$
Hence $$\phi_K(6630\mathscr{O}_K)=\phi_K((1+i)\mathscr{O}_K)\phi_K((1-i)\mathscr{O}_K)\phi_K(3\mathscr{O}_K)\ldots\phi_K((1-4i)\mathscr{O}_K)$$ My problem is that i don't know how to compute cardinality of factor rings. For example, what is the cardinality of $\mathbb{Z}[i]/(1+i)\mathbb{Z}[i]$?..or the cardinality of $\mathbb{Z}[i]/(1+2i)\mathbb{Z}[i]$? The only fact i know is that all these factor rings are finite fields, hence of positive characteristic $p$, hence their cardinality is of the form $p^n$, but...what $p$, what $n$?
EDIT: ...the final result is $2^2\cdot 3\cdot 5^2\cdot 13^2\cdot 17^2=14652300$