With this expression, which values of n gives integer results?

245 Views Asked by At

I need to know when would this equation give integer values, I think there might be an easy method I am not aware of, so I am asking here to know if such method/technique is known for finding a General solution for values of n

$$Odd = \frac{(2^n)-1}{3}$$

2

There are 2 best solutions below

3
On

The method you are after is the usage of Modular Arithmetic.

For $\frac{2^n-1}3$ to give an integer, we need $$2^n-1\equiv0\mod3\\2^n\equiv1\mod 3$$ The inverse of $2\mod3$ is $2$, so $2^2\equiv 1\mod3$, so we can multiply of divide by $2^2$ freely. Then $$2^{n-2k}\equiv1\mod3\quad\forall k$$So you need $n=2k$, i.e. $n$ must be even.

0
On

By the binomial theorem, $2^n-1 = (3-1)^n-1 = 3a+(-1)^n$ and so $3$ divides $2^n-1$ iff $n$ is even.