How find the number of $z$,such that$ |a^2-b^2-b+1|\le 10$ let $f:C\longrightarrow C$ and $f(z)=z^2+zi+1$,find the number of $z$,such $Im(z)&gt;0$
and $|Im(f(z))|\le 10,|Re(f(z))|\le 10$,and $ Im(f(z)) ,Re(f(z)) $are integer numbers.
where $i=\sqrt{-1}$,

$A:399,   B:401,  C:413,   D:431,   E:441$

my idea:let $z=a+bi,b&gt;0$, then 
$$f(z)=z^2+iz+1=(a+bi)^2+i(a+bi)+1=(a^2-b^2-b+1)+(2ab+a)i$$

so:
$|a^2-b^2-b+1|\le 10,|2ab+a|\le 10$,and
$a^2-b^2-b+1\in Z,2ab+a\in Z,b&gt;0$
then this problem equalitly find the number pairs$(a,b)$? But I can't find .

Thank you everyone,
If this is a competition or homework or exam and you will use anything below, you should clearly indicate it in your answer. It is a matter of honor. Or stop reading.

We are told that the real and imaginary parts of $f(z)$ are integers not greater than 10 in the absolute value and the imaginary part of $z$ is positive. So the imaginary part of $f(z)$ is between $-10$ and $10$ (21 possibilities). The real part is between $-10$ and $+10$ (21 possibilities). When multiplied, we have $21\times 21=441$ possibilities for what $f(z)$ may be. But we're not finished yet.

Now, we want to  count the possibilities for $z$. Here, $z^2+zi+1=f(z)$ for a fixed $f(z)$ is a quadratic equation that typically has two distinct solutions for $z$; the map is mostly two-to-one and about one of the two solutions has $f(z)\gt 0$. There are a few subtleties, however. In some cases, the two solutions may coincide. And we must take care of the special case ${\rm Im}(z)\sim 0$; some of those values of $z$ have to be eliminated (see below).

First, the quadratic equation can't have double (degenerate) roots because the discriminant $b^2-4ac$ only vanishes for $f(z)=5/4$ which hasn't an integral real part so this is not a problem. Also, the pair of solutions for one choice of $f(z)$ is always different from any element of any pair for another value of $f(z)$ because the solutions are given as $1/2(-i\pm \sqrt{4f(z)-5})$. It is self-evident that different values of $f(z)$ produce different values of $z$ symmetrically distributed from $-i/2$.

So the only problem is to look at the values of $f(z)$ for which the imaginary part of $z$ isn't positive exactly for one of the two solutions. But that may only occur if $|{\rm Im}(\sqrt{4f(z)-5})|\leq 1$ (the factors of $1/2$ cancel). That may occur if the square root is close enough to the real axis. It means that $4f(z)-5$ must be close enough to the positive real semiaxis.

One has to go through the few dozens of numbers near the positive real semiaxis. We eliminate all the roots for $f(z)$ equal to $1,2,3,\dots 10$ (ten values of $f(z)$), and $2\pm i,3\pm i,4\pm i,\dots 10\pm i$ (eighteen values of $f(z)$ in total here), and $5\pm 2i,6\pm 2i,\dots 10\pm 2i$ (twelve values), $10\pm 3i$ (two values). Note that all the initial numbers $1;2\pm i; 5\pm 2i; 10\pm 3i$ were eliminated "marginally" and would stay there is one allowed all non-negative ${\rm Im}(z)$ rather than the strictly positive ones.

So for $10+18+12+2=42$ values of $f(z)$, there are no acceptable solutions $z$ because of the condition on the imaginary part of $z$. For the remaining $441-42=399$ of $f(z)$ values, there is a unique solution per point and they're all distinct. So the right answer is A:399.

Your approach was counterproductive. There's no reason to divide the complex number $z$ to its real and imaginary part; on the contrary, it's right to view this number as a unified complex number for as long as possible a part of the calculation. The simple grid-like integrality condition affected $f(z)$ and not $z$ which is why we looked at the grid in the $f(z)$ plane and not the $z$ plane as you proposed.
From these: $b&gt;0$ and $|2ab+a|\leq 10$ it follows:
$$-10\leq 2ab+a\leq 10 \iff \frac{-10-a}{2}\leq ab\leq\frac{(10-a)}{2}. $$
Then you should take three cases: when $a&gt;0$, $a=0$ or $a&lt;0$. Just for an example of a needed pair let's take $a=0$. Then everything above holds and $|a^2-b^2-b+1|=|-b^2-b+1|$, so $|-b^2-b+1|\leq 10$,  for example $b=1,2$ and pairs $(a,b)=(0,1), (0,2)$. But you can find more pairs by evaluating inequalities.