Fixed point of multiplicative order of $2 \bmod 2n+1$ Consider the sequence (OEIS 2326) $a_n$ ($n\in\mathbb N$) such that $a_n>0$ is the least positive integer such that $$2^{a_n}\equiv 1[2n+1]$$
This is easy to prove that $$1+\log_2(n+1)\le a_n\le 2n+1$$
But what is the set $F=\left\{n\mid a_n=n\right\}$ ? Is $F$ infinite ?
 A: It isn't too hard to see that if we want $a_n=n$, then $2n+1$ must be a prime $2n+1=p \equiv \pm 1 \pmod{8}$. 
Indeed, observe that since $n$ is the order of $2 \pmod{2n+1}$, we necessarily have $n \mid \phi(2n+1)$ and also $n\mid \lambda(2n+1)$, where $\lambda(m)$ is the Carmichael function. 
Note that $0<\phi(2n+1) \leq 2n$ so $\phi(2n+1)=n, 2n$. In any case, we have $(\phi(2n+1), 2n+1)=1$, so $2n+1$ must be squarefree.
If $pq \mid 2n+1$ for distinct primes $pq$, then $\phi(2n+1)<2n$, so $0<\lambda(2n+1) \leq \frac{\phi(2n+1)}{2}<\frac{2n}{2}=n$, a contradiction.
Therefore $2n+1$ is prime. Write $2n+1=p$. Note that $2$ must be a quadratic residue $\pmod{p}$, since $2^{\frac{p-1}{2}} \equiv 1 \pmod{p}$. Therefore $p \equiv \pm 1 \pmod{8}$.

However now we need to characterise all primes $p \equiv \pm 1 \pmod{8}$ such that $2$ can be written as $g^2 \pmod{p}$, where $g$ is a primitive root $\pmod{p}$ (so order of $2$ will be $\frac{p-1}{2}=n$). 
This doesn't seem too easy; consider the related problem of whether there are infinitely many primes such that $2$ is a primitive root $\pmod{p}$, which to my knowledge remains unsolved despite significant progress (See Artin's conjecture)
