For my lesson on order, one of the exercises my teacher gave me was Question 3 of the 1990 IMO paper:
Find all integers $n>1$ such that $\frac{2^n+1}{n^2}$ is an integer.
My attempt:
We have $$n^2|2^n+1\Rightarrow2^n+1\equiv0\pmod{n^2}\Rightarrow2^n\equiv-1\pmod{n^2}\Rightarrow2^{2n}\equiv1\pmod{n^2}$$ Either $\text{ord}_{n^2}(2)=1$, $\text{ord}_{n^2}(2)=2$, $\text{ord}_{n^2}(2)=d$ where $d|n$, or $\text{ord}_{n^2}(2)=2d$ where $d|n$ but $2d\nmid n$.
If $\text{ord}_{n^2}(2)=1$, $2^1\equiv1\pmod{n^2}$, then $n^2=1\Rightarrow n=1$. This contradicts the requirements for $n$.
If $\text{ord}_{n^2}(2)=2$, $2^2\equiv1\pmod{n^2}$, then $n^2=1$ or $3$ so $n$ is $1$ or $\sqrt3$. This also contradicts the requirements for $n$.
If $\text{ord}_{n^2}(2)=d$ then there exists an integer $k$ such that $dm=n$. Then $2^n=2^{dm}=\left(2^d\right)^m\equiv1^m=1\pmod{n^2}$. This contradicts $2^n\equiv-1$ which we showed earlier.
Therefore $$\text{ord}_{n^2}(2)=2d$$
By Euler's Theorem $2^{\phi(n^2)}\equiv1\pmod{n^2}$, so $2d|\phi(n^2)$. As $\phi(n)=n\prod_{p|n}\frac{p-1}p=nk$ where $k=\prod_{p|n}\frac{p-1}p$, and $n$ and $n^2$ share the same prime factors, we have $$\phi(n^2)=n^2\prod_{p|n}\frac{p-1}p=n\left(n\prod_{p|n}\frac{p-1}p\right)=n(nk)=n\phi(n)$$
Continuing,
$$2d|\phi(n^2)\Rightarrow2d|n\phi(n)\Rightarrow2|m\phi(n)$$
Where $dm=n$. This means either $m$ is even (which implies $n$ is even) or $\phi(n)$ is even.
Unfortunately, I am still far from actually solving the problem. It's clear that showing $n$ is even or $\phi(n)$ is even is not sufficient to show that $\frac{2^n+1}{n^2}$ is an integer (counterexamples include $n=4$ and $n=5$). There are infinitely many numbers satisfying the conditions I laid down. However, I'm not sure how to proceed, so I would like some assistance in finishing the question.
$\textbf{Hint:}$Consider the smallest prime divisor of $n$.
Then use the "lifting the exponent " lemma.
Then again consider the second smallest prime of $n$
At first consider the smallest prime divisor say $p$ of $n$.It can't be $2$. Then, $2^{2n}=1 \pmod {p}$,but also by FLT $2^{p-1}=1 \pmod {p}$.
These two together implies that $2^{gcd(p-1,2n)}=1 \pmod {p}$.But now, $gcd(p-1,2n)=2$ since,any other prime of $n$ would be bigger than $p-1$.This implies that $3$ has to be the smallest prime of $n$ .since $2^2=1 \pmod{p}$ from above.
Now deduce using that lifting the exponent lemma that the highest power of $3$ dividing $n$ is $1$.Then, consider the smallest prime of $n/3$.
Use similar argument as above to show it has to be $7$.But from the fact that $3 \mid n$ show that that can't happen.So,the only solution would be $n=3$
(details are ommited since I wrote it to serve it as a hint)
For detailed solution .see here :aops