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:

| $x$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
| ---: | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| $x^{2}$ | 0 | 1 | 4 | 2 | 2 | 4 | 1 |

Thus, the only possible case is $x \equiv y \equiv 0[7]$. We then have $x=7a, y=7b$. It follows that: $7\left(a^{2}+b^{2}\right)=11+3 \cdot 288 \cdot 2016^{z-1} \cdot \text{If } 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$, which means 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)\}$.