Divisibility of $n\cdot2^n+1$ by 3.

It should also be clear that if $n$ is divisible by $3$, then $n\cdot 2^n$ is divisible by $3$ so $n\cdot 2^n + 1$ is not divisible by $3$.

Therefore, the only candidates are $n=3k+1$ and $n=3k+2$.

Now, look at the remainders of $2^n$ when divided by $3$:

$$2^1\equiv 2\mod 3\\ 2^2\equiv 1\mod 3\\ 2^3\equiv 2\mod 3\\ 2^4\equiv 1\mod 3\\ 2^5\equiv 2\mod 3\\\vdots$$

and so on. You can clearly see that $2^k\equiv 2\mod 3$ for odd $k$ and $2^k\equiv 1\mod 3$ for even $k$.


So, let's look at the whole expression depending on how $n$ is divisible by $6$:

  • If $n\equiv 0\mod 6$, then $n$ is divisible by $3$, so $n\cdot2^n+1$ is not divisible by $3$.
  • If $n\equiv 1\mod 6$, then $n$ is odd, so $2^n\equiv 2\mod 3$. Since $n\equiv 1\mod 3$, this means $$n\cdot 2^n\equiv 1\cdot 2\equiv 2\mod 3$$ meaning that $n\cdot 2^n+1\equiv 2+1=3\equiv 0\mod 3$ so $n\cdot2^n+1$ is divisible by $3$
  • If $n\equiv 2\mod 6$, then $n$ is odd and $n\equiv 2\mod 3$. Because $n$ is odd, $2^n\equiv 1\mod 3$, and therefore $n\cdot 2^n\equiv 2\cdot 1\equiv 2\mod 3$ meaning $n\cdot 2^n+1\equiv 2+1\equiv 0\mod 3$, so again, $n\cdot 2^n +1$ is divisible by $3$.

I trust you can finish the rest of the cases yourself...


The sequence $a_n=n\cdot 2^n$ satisfies the recursion $$ a_0=0,\quad a_1=2,\quad a_{n+2}=4a_{n+1}-4a_n $$ Indeed, if we assume the thesis to hold for all $k<n$, with $n>2$, we have $$ a_{n}=4a_{n-1}-4a_{n-2}=4(n-1)\cdot2^{n-1}-4(n-2)\cdot2^{n-2} =4\cdot2^{n-2}(2n-2-n+2)=n\cdot2^n $$ If $b_n$ denotes the remainder class of $a_n$ modulo $3$, we have $$ b_{n+2}=4b_{n+1}-4b_n=b_{n+1}-b_n $$ and we want to see for what $n$ we have $b_n=2$ (I denote the remainder classes modulo $3$ just by $0$, $1$ and $2$).

It is clear that, whenever two consecutive terms repeat, the sequence will restart with the same terms all over; let's see: \begin{align} b_0&=0 \\ b_1&=2 \\ b_2&=b_1-b_0=2 \\ b_3&=b_2-b_1=0 \\ b_4&=b_3-b_2=1 \\ b_5&=b_4-b_3=1 \\ b_6&=b_5-b_4=0 \\ b_7&=b_6-b_5=2 \end{align} Then $b_8=b_2$, $b_9=b_3$ and so on.