The number of solutions of $x^2+2016y^2=2017^n$ 
The number of solutions of $x^2+2016y^2=2017^n$ is $k$. Write $k$ with $n$.

For $n = 1$, the only solution is $(1,1)$. For $n = 2$, it gets more complicated. Taking the equation modulo $2016$ we find that $x^2 \equiv 1 \pmod{2016}$. How do we continue?
Solving for $y$ we get $$y = \pm \sqrt{\dfrac{2017^n-x^2}{2016}}.$$

If $x^2+2016y^2$ is divisible by $2017$, then taking $\mod 2017$ shows that $x\equiv\pm y\mod2017$. Then
$\left(\dfrac{x\pm2016y}{2017}\right)^2+2016\left(\dfrac{y\mp x}{2017}\right)^2=\dfrac{x^2+2016y^2}{2017}$,
shown just by expanding out. We can choose the sign of each of those so that the numbers are actual integers, not just rationals. Now in the case of $x^2+2016y^2=2017^n$, we can just use this to whittle our way down to $1$.
Now there's another way of looking at this construction. What I did was I took $x+y\sqrt{-2016}$ and noted that multiplying it by its conjugate gives you $x^2+2016y^2$. And we also determined that one of $\frac{x+y\sqrt{-2016}}{1+\sqrt{-2016}}$ and $\frac{x+y\sqrt{-2016}}{1-\sqrt{-2016}}$ can be written in the form $c+d\sqrt{-2016}$ where $c$ and $d$ are integers. And we also determined that continuing to divide what we get by the appropriate choice between $1\pm\sqrt{-2016}$, we eventually get down to either $1$ or $-1$.
So $x+y\sqrt{-2016}=\pm(1+\sqrt{-2016})^u(1-\sqrt{-2016})^v$ with $u+v=n$. This gives all such $x$ and $y$, and each $x$ and $y$ are determined by exactly one sign and pair $(u,v)$. This last statement is not difficult to prove; to do so, write out two different representations of a number in that form, divide out by the common factors and sign, and obtain $(1+\sqrt{-2016})^r=\pm(1-\sqrt{-2016})^r$ for some $r$. Then multiply both sides by $(1+\sqrt{-2016})^r$; on one side you get $(1+\sqrt{-2016})^{2r}$ which is not divisible by $2017$, but on the other side you get $\pm2017^r$, which is. So any representation must be unique.
So we can get any pair $x$ and $y$ that work from the equation
$x+y\sqrt{-2016}=\pm(1+\sqrt{-2016})^u(1-\sqrt{-2016})^v$
but the question (I assume) was asking about nonnegative (or positive) $x$ and $y$. Swapping $u$ and $v$ changes the sign of $y$, and swapping the sign in front changes both $x$ and $y$. And if $n$ is even then $u=v$ gives $x=2017^{\frac{n}{2}}$ and $y=0$. Otherwise, we can take $u>v$ and the choice of sign to be positive, and then just take the absolute value of the coefficients. So that should give us $\frac{n+1}{2}$ if $n$ is odd, and $\frac{n+2}{2}$ if you allow that exceptional $b=0$ case, or $\frac{n}{2}$ if not.
That is, there are $\left\lfloor\frac{n+2}{2}\right\rfloor$ pairs $(x, y)$ if you allow $y=0$, or $\left\lfloor\frac{n+1}{2}\right\rfloor$ if you don't.
