Inspired by this question here :
I now consider the smallest cases of non-UFD. I did not skip class number 2, it appears to be a fact that they have class number 3.
Anyways,
Consider the ring $A = \Bbb Z[\frac{1+\sqrt {-23}}{2}]$ with the elements $\frac{a+b\sqrt {-23}}{2}$ where $a,b$ are both even or both odd integers.
This is also known as the ring of integers in the imaginary quadratic field $\Bbb Q[\sqrt {-23}]$.
Consider also the ring $B = \Bbb Z[\frac{1+\sqrt {-31}}{2}]$ with the elements $\frac{c+d\sqrt {-31}}{2}$ where $c,d$ are both even or both odd integers.
This is also known as the ring of integers in the imaginary quadratic field $\Bbb Q[\sqrt {-31}]$.
Both $A$ and $B$ are non-UFD with class number $3$.
Consider $f_{23}(r)$ as the number of irreducibles in $A$,such that $1 < a^2 + b^2 < r$ and likewise
Consider $f_{31}(r)$ as the number of irreducibles in $B$,such that $1 < c^2 + d^2 < r$.
How to show that
$$ g(r) = f_{23}(r) - f_{31}(r)$$
changes sign infinitely often
is unbounded for both positive and negative output
is equal to zero infinitely often
Plots are welcome too !