Let $f : \mathbb{C} \to \mathbb{C}$ be defined by $f(z) = z^2 + iz + 1$. How many complex numbers $z$ are there such that $\text{Im}(z) > 0$ and both the real and the imaginary parts of $f(z)$ are integers with absolute value at most $10$?
$\textbf{(A)} \ 399 \qquad \textbf{(B)} \ 401 \qquad \textbf{(C)} \ 413 \qquad \textbf{(D)} \ 431 \qquad \textbf{(E)} \ 441$
Suppose $f(z)=z^2+iz+1=c=a+bi$. We look for $z$ with $\operatorname{Im}(z)>0$ such that $a,b$ are integers where $|a|, |b|\leq 10$.
First, use the quadratic formula:
$z = \frac{1}{2} (-i \pm \sqrt{-1-4(1-c)}) = -\frac{i}{2} \pm \sqrt{ -\frac{5}{4} + c }$
Generally, consider the imaginary part of a radical of a complex number: $\sqrt{u}$, where $u = v+wi = r e^{i\theta}$.
$\operatorname{Im}(\sqrt{u}) = \operatorname{Im}(\pm \sqrt{r} e^{i\theta/2}) = \pm \sqrt{r} \sin(\theta/2) = \pm \sqrt{r}\sqrt{\frac{1-\cos\theta}{2}} = \pm \sqrt{\frac{r-v}{2}}$.
Now let $u= -5/4 + c$, then $v = -5/4 + a$, $w=b$, $r=\sqrt{v^2 + w^2}$.
Note that $\operatorname{Im}(z)>0$ if and only if $\pm \sqrt{\frac{r-v}{2}}>\frac{1}{2}$. The latter is true only when we take the positive sign, and that $r-v > 1/2$,
or $v^2 + w^2 > (1/2 + v)^2 = 1/4 + v + v^2$, $w^2 > 1/4 + v$, or $b^2 > a-1$.
In other words, when $b^2 > a-1$, the equation $f(z)=a+bi$ has unique solution $z$ in the region $\operatorname{Im}(z)>0$; and when $b^2 \leq a-1$ there is no solution. Therefore the number of desired solution $z$ is the same as the number of ordered pairs $(a,b)$ such that integers $|a|, |b|\leq 10$, and that $b^2 \geq a$.
When $a\leq 0$, there is no restriction on $b$ so there are $11\cdot 21 = 231$ pairs;
when $a > 0$, there are $2(1+4+9+10+10+10+10+10+10+10)=2(84)=168$ pairs.
So there are $231+168=\boxed{399}$ in total.