<s>[INST] If $a^n+n^{a}$ is prime number and $a=3k-1$ then $n\equiv 0\pmod 3$? Is it true that :

If $a^n+n^{a}$ is prime number and $a=3k-1$ then $n\equiv 0\pmod 3$
where $a>1,n>1 ; a,n,k  \in \mathbb{Z^+}$

I have checked statement for many pairs $(a,n)$ and it seems to be true.
Small Maple code that prints $(a,n)$ pairs :

Any idea how to prove this statement ?
 [/INST] Since it is prime, we know that $a^n+n^a \equiv 1 \text{ or } 5 \mod 6$, and because $a \equiv 2 \mod 3$ we know that $a \equiv 2 \text{ or } 5 \mod 6.$  
The case $a \equiv 2 \mod 6:$
Note that $n^2 \equiv n^8 \equiv n^{14} \dots \mod 6.$
When $n \equiv 0, 1, 2, 3, 4, 5 \mod 6, n^2 \equiv 0, 1, 4, 3, 4, 1 \mod 6$ and $2^n \equiv 4, 2, 4, 2, 4, 2 \mod 6.$
Adding these gives $a^n+n^a \equiv 4, 3, 2, 5, 2, 3 \mod 6$. 1 does not appear at all and 5 appears only when $n \equiv 3 \mod 6,$ meaning that $n \equiv 0 \mod 3,$ as required.  
The case $a \equiv 5 \mod 6:$
Note that $n^5 \equiv n^{11} \equiv n^{17} \dots \mod 6.$
When $n \equiv 0, 1, 2, 3, 4, 5 \mod 6, n^5 \equiv 0, 1, 2, 3, 4, 5 \mod 6$ and $5^n \equiv 1, 5, 1, 5, 1, 5 \mod 6.$
Adding these gives $a^n+n^a \equiv 1, 0, 3, 2, 5, 4 \mod 6$. 1 appears only when $n \equiv 0\mod 6$, implying that $n \equiv 0 \mod 3,$ as required.
However, 5 appears as well, when $n \equiv 4 \mod 6,$ suggesting the possibility of the result being false for these values of $a$ and $n$.
Edit
I have found that $a=215$ and $n=76$ is a counterexample.  $a^n+n^a$ is prime, $a \equiv 2 \mod 3$ but $n\not\equiv 0 \mod 3$.
</s>