Okay, so here's an interesting approach to the matter, in my opinion. It's probably not the best, but it was the first that came to mind since I knew this (relatively?) obscure bit of knowledge.
The mathematical underpinning of this idea, in terms of validity, is tied to modular arithmetic, and is explained a bit at a Stack Overflow post here.
Imagine the number $2^N+1$ in binary. Owing to how binary is written and that $1=2^0$, this basically amounts to
$$2^N + 1 = 1\underbrace{000\cdots 000}_{\text{N-1 zeroes}}1$$
In general, if we have a binary number, we can determine if it is divisible by three by the following:
Count the number of nonzero bits in even position, starting at the right. For the binary number $11101$, this would be $1$: the even positions from the right are the second and fourth, which are $0$ and $1$ respectively. For $1111$, there are two (second and fourth from the right.)
Do the same for those in the odd positions. For the above pair of examples, the numbers are $3$ and $2$ respectively.
Call these numbers $E$ and $O$ respectively. If $E-O$ is divisible by three, the original number is too.
For the above examples, $E-O$ is $2$ and $0$ respectively. Thus, $11101$ ($29$) is not divisible by $3$, but $1111$ ($15$) is.
In the case of $2^N+1$, our binary number is $N+1$ digits long, and only has nonzero bits at positions $N$ and $1$.
Consider cases for $N$ even and $N$ odd.
$N$ even: In this case, the first and $(N+1)^{th}$ bits are nonzero. Thus, two nonzero odd bits are there, and none for even. Thus, $E=0,O=2 \implies E-O=2$. $2$ is not divisible by $3$ however, so $2^N+1$ is not divisible by $3$ for $N$ even.
$N$ odd: Similarly, now there is one odd nonzero bit (the first) and one nonzero even bit (the $(N+1)^{th}$). Thus $E=0=1$ and $E-O=0$, which is divisible by $3$. Thus, $2^N+1$ is divisible by $3$ for $N$ odd.