Find when $2^{3^{4^{...^{n}}}} \equiv 1$ (mod $n+1$) is true It is linked to my previous question, I haven't been given any clue for how to verify this modular equation:
$2^{3^{4^{...^{n}}}} \equiv 1$ (mod $n+1$)
How can I find the condition for $n$?

$2^d \equiv 1 \mod (n+1)$ iff $n$ is even and $d$ is divisible by the multiplicative order of $2$ mod $(n+1)$.  So for the condition to be true, you need the multiplicative order of $2$ mod $(n+1)$ to be a power of $3$.  The first few $n$ for which this is the case are
$6, 72, 486, 510, 2592, 3408, 18150, 35550, 39366, 71118, 80190, 97686$.
