Show that $7\mid(3^{2n+1}+2^{n+2})$ for all $n\in\mathbb{N}$ [duplicate]

Prove that the following is true for every $n∈ℕ$:

$$7\mid(3^{2n+1}+2^{n+2}).$$

I've noticed $$3^{2n+1}+2^{n+2} =3^{2n} \cdot 3+2^{n} \cdot 4.$$

Any suggestions how to continue from there to get something like $7k$ for $k\in\mathbb{N}$.

Thank you in advance!


Hint $\ \ 7\mid\color{#c00}{3^2}\!\color{#c00}-\!\color{#c00}2,\,\ 7\mid\overbrace{\color{#0a0}{3^{2k+1}}\!\color{#0a0}+\! \color{#0a0}{2^{k+2}}}^{\large P(k)} \Rightarrow\, 7\mid 2(\color{#0a0}{3^{2k+1}\!\!+\!2^{k+2}}) + (\color{#c00}{3^2\!-2})3^{2k+1}\! =\, \overbrace{3^{2k+3}\!+2^{k+3}}^{\large P(k+1)}$

Or, notice $\ 2^2\!+2+1 = 7\ $ so we can apply

Lemma $\ \ a^2\!+a+1\mid a^{n+2}+(a+1)^{2n+1}\! =: b$

Proof $\, \ {\rm mod}\,\ a^2\!+a+1\!:\ \color{#0a0}{a(a+1)\equiv -1}$ and $\,\color{#c00}{a^3\equiv 1}\ $ by $\,0\equiv (a\!-\!1)(a^2\!+a+1) = a^3\!-1,\,$ so

$\qquad\quad\! a^{2n+1}b = a^{3n+3} + (\color{#0c0}{a(a+1)})^{2n+1} \equiv\, (\color{#c00}{a^3})^{n+1}\!-1\equiv 0\ $ so $\ b\equiv 0\ \ $ QED

Remark $\ $ Below I explain how the first explicit inductive proof is a special case of the latter congruence arithmetic proof, which boils down to $\color{#0a0}{(-1)^{2n+1}\equiv -1}\,$ and $\color{#c00}{1^{n+1}\equiv 1},\,$ both of which have trivial inductive proofs (a special case of the Congruence Power Rule inductive proof).

Here is the inductive step $\,P(k)\,\Rightarrow\,P(k\!+\!1)\,$ written in intuitive congruence arithmetical form

$$\begin{eqnarray} {\rm mod}\ 7\!:\quad\ \ \color{#c00}{3^{\large 2}} &\equiv& \color{#c00}2\\ \color{#0a0}{3^{\large 2k+1}}&\equiv& \color{#0a0}{-2^{\large k+2}},\quad\ {\rm i.e.}\ \ \ P(k)\\ \Rightarrow\ \ 3^{\large 2(k+1)+1} &\equiv& \color{#c00}{3^{\large 2}}\: \color{#0a0}{3^{\large 2k+1}}\\ &\equiv& \color{#c00}2 (\color{#0a0}{- 2^{\large k+2}})\\ &\equiv& {-}\!2^{\large k+3},\quad {\rm i.e.}\ \ \ P(k+1) \end{eqnarray}\qquad$$

by the Congruence Product Rule $\ A\equiv a,\ B\equiv b\,\Rightarrow\, AB\equiv ab.\, $ If congruence arithmetic is unfamiliar it can be eliminated by unwinding the proof of the Product Rule, yielding

$\quad \begin{eqnarray} 0\,\equiv\, \color{#c00}{A}&\color{#c00}-&\color{#c00}a, &&\ \color{#0a0}{B}&\color{#0a0}-& \color{#0a0}b &\Rightarrow& \qquad AB\ -\ ab &=& a\ \ (\color{#0a0}{\ B\ \ -\ \ b}\ ) &+& (\color{#c00}{A-a})B\,\equiv\, 0\\ 7\,\mid\, \color{#c00}{3^2}&\color{#c00}-&\color{#c00}2, && \color{#0a0}{3^{2k+1}}\!&\color{#0a0}+&\! \color{#0a0}{2^{k+2}} &\Rightarrow& 7\mid 3^{2k+3}\!+2^{k+3}\! &=& 2(\color{#0a0}{3^{2k+1}\!+2^{k+2}}) &+& (\color{#c00}{3^2\!-2})3^{2k+1}\phantom{I^{I^I}} \\ \end{eqnarray}$

The prior is precisely the standard inductive proof that is usually pulled out of hat, like magic, without any intuitive motivation. We can employ further congruence arithmetic to make it even more obvious than above. Note $\,P(k)\,$ is $\,3\cdot 9^k\equiv -4\cdot 2^k\equiv 3\cdot 2^k\ $ so $\,P(k\!+\!1)$ arises simply by multiplying by $\,9\equiv 2\ $ to get $\, P(k\!+\!1)\!:\ 3\cdot 9^{k+1}\equiv 3\cdot 2^{k+1}.\, $ Even more clearly, by dividing, we see that $\,P(k)\,$ is equivalent to $\,(9/2)^k\equiv 1.\,$ But $\,9\equiv 2\,$ so $\,9/2\equiv 1,\,$ so the induction boils down to the trivial induction that $\,1^k\equiv 1,\,$ which is a simple special case of the inductive proof of the Congruence Power Rule.

Similarly, many inductions can be transformed into such standard or trivial inductions. Hence it is well-worth the effort to spend some time looking for such innate structure. This is especially true for divisibility problems, since transforming to congruence form allow us to exploit our well-honed arithmetical intuition, which is much stronger than our intuition on divisibility relation caculus.


Note that $2 \equiv 3^2 \pmod 7$, therefore $$ 3^{2n+1} + 2^{n+2} \equiv 3^{2n+1} + 3^{2n+4} \equiv 3^{2n+1} \cdot 28 \pmod 7, $$ and that is of course divisible by $7$.


\begin{align}3^{2n+1}+2^{n+2}=3\cdot 9^n + 4\cdot 2^n&=7\cdot 9^n -4(9^n-2^n)\\ &=7\cdot 9^n-4(9-2)(9^{n-1}+9^{n-2}\cdot2+\cdots+2^{n-1})\\ &=7[ 9^n-4(9^{n-1}+9^{n-2}\cdot 2\cdots+2^{n-1})]\end{align}

Which is divisible by $7$

Here is a solution based on congruences,

$$3\cdot 9^n +4\cdot 2^n \equiv 3\cdot 2^n +4\cdot 2^n \equiv 7\cdot 2^n \equiv 0\text{(mod 7)}$$


We have

$$3^{2n+1}+2^{n+2}=3\times\color{red}9^n+4\times2^n\equiv3\times\color{red}2^n+4\times2^n=7\times2^n\equiv0\mod7$$


Note that a sequence with form $u_n=a\cdot 9^n+b\cdot 2^n$ satisfies a linear recurrence with auxiliary equation $$(x-9)(x-2)=0$$ so that $$u_{n+1}=11u_n-18u_{n-1}$$

Hence if $7|u_n \& 7|u_{n-1}$ then $7|u_{n+1}$. We have $u_0=7, u_1=35$ both divisible by $7$, so with a base case established we are done by induction.

If $u_n=7k_n$, then $k_n$ satisfies the same recurrence with $k_0=1, k_1=5$