Find all triplets of natural numbers $(x, y, z)$ such that:

$$
x^{2}+y^{2}=3 \cdot 2016^{z}+77
$$
Suppose $z \geqslant 1$, since $7 \mid 2016, x^{2}+y^{2} \equiv 0[7]$. Now, modulo 7, we have:

![](https://cdn.mathpix.com/cropped/2024_05_10_00138f973c2e12c014a0g-138.jpg?height=105&width=1710&top_left_y=2079&top_left_x=183)
7b. It follows that: $7\left(a^{2}+b^{2}\right)=11+3 \cdot 288 \cdot 2016^{z-1} \cdot \mathrm{Si}, z \geqslant 2$, then the right-hand side would not be divisible by 7. Therefore, $z=1$. We then have: $7\left(a^{2}+b^{2}\right)=11+3 \cdot 288=875$, so $a^{2}+b^{2}=125$, hence necessarily, $a, b<12$. We find manually: $\{a, b\} \in\{\{11,2\},\{10,5\}\}$. This gives $(x, y, z) \in\{(77,14,1),(14,77,1),(70,35,1),(35,70,1)\}$. Otherwise, we have $z=0$, and then $x^{2}+y^{2}=80$, so $x, y<9$. We test manually and obtain the other solutions: $(x, y, z) \in\{(8,4,0),(4,8,0)\}$.