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}}.$$
 A: 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.
A: The ring of integers of the imaginary quadratic field $\mathbf Q(\sqrt - 2016) = \mathbf Q(\sqrt -14)$ is $R = \mathbf Z[\sqrt - 14]$ because $-14\equiv 2$ mod $4$ . Write $(E_n)$ for the equation $x^2 + 2016 y^2 = 2017^n$. Note that the only solution for $(E_1)$ is $(1, 1)$. In $R$, the equation $(E_n)$ can be decomposed into products as $ (x + 12y\sqrt -14).(x-12y\sqrt -14) = 2017^n$, and the existence of the solution for $(E_1)$ shows that the prime 2017 splits in $R$ as a product of two prime conjugate ideals: $2017 R = \mathfrak p .\mathfrak p'$ (this could of course be proved directly by computing quadratic residues). Moreover the uniqueness of the prime decomposition in a Dedekind ring shows that $\mathfrak p$ and $\mathfrak p'$ are principal, say $\mathfrak p =(1+12\sqrt -14)$ and $\mathfrak p' =(1-12\sqrt -14)$. 
Thus $(E_n)$ reads  $ (x + 12y\sqrt -14).(x-12y\sqrt -14)R = \mathfrak p^n.\mathfrak p'^{n}$, and again, uniqueness shows that $ (x + 12y\sqrt -14)R =(1\pm12\sqrt -14)^nR$  , or equivalently, $ (x + 12y\sqrt -14)=u(1\pm12\sqrt -14)^n$, where $u$ is a unit of $R$. But such a unit has norm $1$, and since the diophantine equation $a^2 + 14b^2 = 1$ has the only solution $a=\pm1$, we get $ (x + 12y\sqrt -14)=\pm(1\pm12\sqrt-14)^n$ . I let you write down the explicit solutions of $(E_n)$ and their number according to the parity of $n$.
