0

I want to investigate for which $n\geq0$ the expression $n*2^n + 1$ is divisible by $3$. I’ve tried applying Fermat’s little theorem but without any success and believe this is not the correct way to go about it. Any tips or hints would by highly appreciated.

Best regards, David

Bernard
  • 175,478

3 Answers3

2

Observe that if $n$ is even ($n=2k$) then $2^n \equiv (2^2)^k \equiv 1^k \equiv 1 \pmod{3}$ and when $n$ is odd then $2^n \equiv -1 \pmod{3}$.

Let $n$ be even, then \begin{align*} n2^n+ 1 & \equiv n(1)+1 \pmod{3}\\ & \equiv n+1 \pmod{3} \end{align*}

We want this to be $0 \mod 3$, so $n \equiv 2 \pmod{3}$. We have the following conditions on $n$, $$n \equiv 0 \pmod{2} \quad \text{and} \quad n \equiv 2 \pmod{3}.$$

This can be consolidated as $n \equiv 2\pmod{6}$.

Likewise you can deal with the other case.

Anurag A
  • 41,067
  • This was very helpful, thanks. For the odd case I get:

    $n*2^n + 1 ≡ -n + 1 mod 3$ and $n ≡ 1 mod 2$

    Does this consolidate to $n ≡ -1 mod 2$ ?

    –  Aug 15 '19 at 08:11
  • Should be mod 6 on the last relation –  Aug 15 '19 at 08:17
  • 1
    I understand now, as you can simplify the odd case to:

    $n ≡ 1 mod 2$ (being odd) $n ≡ 1 mod 3$

    Which consolidates to $n ≡ 1 mod 6$

    Thanks again!

    –  Aug 15 '19 at 10:06
  • To the person who is downvoting: please have the decency to state a reason as well. If there is an improvement needed then I can do it otherwise perhaps it may help improve your own understanding as well. – Anurag A Aug 16 '19 at 19:00
1

Hint $\bmod 3\!:\ 2^{\large n+2}\equiv 2^{\large n}\Rightarrow\, f(n\!+\!\color{#c00}6)\equiv f(n)$ so we need to test only $\color{#c00}6$ values $\,n = 0,1\,\ldots,5$

Remark $ $ Such $\color{#c00}{\text{periodicity}}$ holds much more generally, e.g. above is the special case of the Lemma below where $\,f(x,y) = xy+1,\ g(x) = 2^{\large x},\, m,n = 2,3$.

Lemma $ $ If $\,f:\Bbb Z^2\to \Bbb Z,\,\ g:\,\Bbb N\to \Bbb Z\,$ and $f$ is a polynomial with integer coef's then

$\!\bmod n\!:\,\ \forall x\in \Bbb N\!:\ g(x\!+\!m)\equiv g(x)\ \Rightarrow\ \forall x\in \Bbb N\!:\ f(x\!+\!\color{#c00}{mn},\,g(x\!+\!\color{#c00}{mn}))\equiv f(x,g(x)) $

Proof $\, \begin{align} x\!+\!mn&\,\equiv\, x\\ g(x\!+\!mn)&\equiv g(x)\end{align}$ $\Rightarrow \begin{align} &\ f(x\!+\!mn,\,g(x\!+\!mn))\\ \equiv\, &\ f(x,\,g(x)) \end{align}$ by the Polynomial Congruence Rule

where $\,\ g(x\!+\!mn)\equiv g(x)\ $ follows from $\,g(x\!+\!m)\equiv g(x)\,$ by induction on $\,n$.

Beware as above $\,g(x)\,$ may not be a polynomial so it needn't satisfy $\,x\equiv y\,\Rightarrow\,g(x)\equiv g(y)$

Bill Dubuque
  • 272,048
0

Write $a_n=n2^n+1^n$ and write $(x-2)^2(x-1)=0$ as $x^3=5x^2-8x+4$. Then $$ a_{n+3} = 5a_{n+2} -8a_{n+1}+4a_n $$ Then $a_n \bmod 3$ is $$ 1,0,0,1,2,2,\color{red}{1,0,0,1,2,1,2,2},\dots $$ Because of the linear recurrence, the sequence repeats as soon as it repeats three consecutive terms, $1,0,0$ in this case.

Bottom line $a_n \equiv 0 \bmod 3$ iff $n \equiv 1,2 \bmod 6$.

lhf
  • 216,483