Some months ago I created a problem:

Find all $n\in\mathbb N$ such that $n|2^n+1$

Later I found that an IMO problem required to find all $n\in\mathbb N$ such that $n^2|2^n+1$

Now do both!

## n^2|2^n+1

- Tahmid Hasan
**Posts:**665**Joined:**Thu Dec 09, 2010 5:34 pm**Location:**Khulna,Bangladesh.

### Re: n^2|2^n+1

first 1 holds iff n is a prime other than 2 (fermat's pichhi thm).

বড় ভালবাসি তোমায়,মা

### Re: n^2|2^n+1

I didn't understand what you meant?$n=p>2$? Or else.Tahmid Hasan wrote:first 1 holds iff n is a prime other than 2 (fermat's pichhi thm).

One one thing is neutral in the universe, that is $0$.

- Tahmid Hasan
**Posts:**665**Joined:**Thu Dec 09, 2010 5:34 pm**Location:**Khulna,Bangladesh.

### Re: n^2|2^n+1

You meant $31|2^{31}+1=2147483649$ for example?

If so,you are wrong,and the original answer is not like that at all,you are true only for $n=3$.Else you are wrong.

why don't you check some easy counter examples?

For example $5\not|2^5+1=33$

According to your assumption,$2^p\equiv -1\pmod p,2^{2p}\equiv 1\pmod p$ and by Fermat's Little Theorem,$2^{p-1}\equiv1\pmod p$

These two imply $2^{gcd(2p,p-1)}\equiv 1\Longrightarrow 2^2\equiv 1\Longrightarrow p=3$

So this is of-course wrong.

Great Hint:

Look at the smallest prime factor of $n$,say it is $p$.Then let $n=p^{v_p(n)}q$ with $p\not|q$.Again if $q>1$,what follows from the same approach?

If so,you are wrong,and the original answer is not like that at all,you are true only for $n=3$.Else you are wrong.

why don't you check some easy counter examples?

For example $5\not|2^5+1=33$

According to your assumption,$2^p\equiv -1\pmod p,2^{2p}\equiv 1\pmod p$ and by Fermat's Little Theorem,$2^{p-1}\equiv1\pmod p$

These two imply $2^{gcd(2p,p-1)}\equiv 1\Longrightarrow 2^2\equiv 1\Longrightarrow p=3$

So this is of-course wrong.

Great Hint:

Look at the smallest prime factor of $n$,say it is $p$.Then let $n=p^{v_p(n)}q$ with $p\not|q$.Again if $q>1$,what follows from the same approach?

One one thing is neutral in the universe, that is $0$.