$\newcommand{\ord}{\operatorname{ord}}$
For what values of $n$ will $n$ divide $a^d+1$ where $n$ and $d$ are positive integers?
Apparently $n$ can not divide $a^d+1$ if $\ord_n a$ is odd.
If $n\mid (a^d+1)\implies a^d\equiv -1\pmod n\implies a^{2d}≡1\pmod n \implies\ord_na\mid 2d$ but $\nmid d$.
For example, let $a=10$, the factor(f)s of $(10^3-1)=999$ such that $\ord_f10=3$ are $27,37,111,333$ and $999$ itself. None of these should divide $10^d+1$ for some integer $d$.
Please rectify me if there is any mistake.
Is anybody aware of a better formula?