Prove by induction that for every $n \ge 0$ the term $2^{2n+1} - 9n^2 + 3n -2$ is divisible by $54$ What I get is $4 \cdot 54k + 27(n(n-1)) - 2$.
I understand first two terms but $-2$ is giving me a headache. I suppose to be true every term should be divisible by $54$. Or did I make wrong conclusion?
P. S: Is there mathjax tutorial?
 A: Let $f(n) = 2^{2n+1}-9n^2+3n-2$; then
\begin{align*}
  f(n+1)-4f(n) &= 2^{2n+3}-9(n+1)^2+3(n+1)-2-4(2^{2n+1}-9n^2+3n-2) \\
      &= 4\cdot 2^{2n+1} - 9n^2 - 18n - 9 + 3n+3-2-4(2^{2n+1}-9n^2+3n-2) \\
      &= 27n^2-27n  = 27n(n-1).
\end{align*}
Since either $n$ or $n-1$ is even, this expression is divisible by $54$. Since $4f(n)$ is divisible by $54$ (inductive assumption), so is $f(n+1)$.
A: No, in general not every term needs to be divisible by $54$ in order for the whole expression to be divisible by $54$
Consider: $56-2$ is clearly divisible by $54$, even if neither $56$ nor $-2$ are.
At the same time, given that in your specific expression the first two terms are divisible by $54$, the remaining third term (the $-2$) should be as well in order for the whole expression to be. Given that it is not, you must have made a mistake.
Now, how did you get to that expression? I assume you got this when working on the inductive step? But how did you end up with both $k$ and $n$ in your expression? That certainly should not happen when you do an inductive proof for this one. So, please post your work so we can try and find your mistake... learning from your mistakes is always more educational than just presenting you with a correct proof.
A: $2^{2n+1}-9n^2 +3n -2 = 54k$ 
$2^{2n+1} =54k +9n^2 -3n +2$
$2^{2(n+1)+1} -9(n+1)^2 +3(n+1) -2=$ 
$2^2(54k +9n^2 -3n +2) -9(n+1)^2 +3(n+1) -2$
After I compute everything, I get this: $4\cdot54k +27(n(n+1)) -2.$
A: You want to prove the divisibility by induction, so let's calculate the first terms.
$\begin{cases}f(0)=0\\f(1)=0\\f(2)=0\end{cases}\quad$ all multiples of $54$.
So hypothetically if you would have an induction relation of the form:
$$f(n)=af(n-1)+bf(n-2)+cf(n-3)+d$$
With $d$ being a multiple of $54$ then your proof by induction would be successful.

In fact, we shall see that it is possible to calculate these coefficients $(a,b,c,d)$.
The solution is $f(n)=(2)\times \color{red}{4^n}+(-9n^2+3n-2)\times \color{red}{1^n}$
So we are searching for a characteristic equation, where $\color{red}4$ and $\color{red}1$ are roots.
Because the constant term $d$ is also $d\times 1^n$, then the degree of the term in $1^n$ is raised by $1$ and we don't need a triple root but only a double root.
So the characteristic equation is $$(x-1)^2(x-4)=x^3-6x^2+9x-4$$

Let's calculate $f(n+3)-6f(n+2)+9f(n+1)-4f(n)=\cdots=54$.
$d=54$ is a multiple of $54$ and you can launch your induction proof.
A: (Alternative approach, without induction.) The following uses the notation $\,\mathcal{M}n\,$ to denote any integer multiple of $\,n\,$. The obvious rules apply $\,2 \cdot \mathcal{M}3 = \mathcal{M}6, \,\mathcal{M}3 \cdot \mathcal{M}3 = \mathcal{M}9\,$ etc.


*

*$\,4^k-1 = \mathcal{M}3\,$ for all $\,k \ge 0\,$, therefore:


$$\require{cancel}
\begin{align}
4^n - 1 &= (4-1)\cdot(4^{n-1}+\cdots+4+1) \\
 &=3 \cdot \big((4^{n-1}-1)+ \cdots + (4-1) + (\cancel{1} - \cancel{1}) + n\big) \tag{1}\\
 &= 3 \cdot (\mathcal{M}3 + n) \\
 &= \mathcal{M}9 + 3n
\end{align}
$$


*

*Using the previous result back in $\,(1)\,$:


$$
\begin{align}
\color{blue}{2 \cdot (4^n - 1)} &=6 \cdot \big((\mathcal{M}9+3(n-1))+ (\mathcal{M}9+3(n-2))+ \cdots + (\mathcal{M}9+3 \cdot 1) + n\big)\\
 &= \mathcal{M}54 + 18\big((n-1)+(n-2)+\cdots+1 \big) + 6n \\
 &= \mathcal{M}54 + 18 \cdot \frac{n(n-1)}{2}+6n \\
 &= \color{blue}{\mathcal{M}54 + 9 n^2 - 3n} \tag{2}
\end{align}
$$
It then follows straight from $\,(2)\,$ that: $$2^{2n+1} - 9n^2 + 3n -2 = \color{blue}{2 \cdot (4^n -1)} -9n^2+3n=\color{blue}{\mathcal{M}54 + \cancel{9 n^2} - \bcancel{3n}} - \cancel{9n^2} + \bcancel{3n}$$
A: As here this can be viewed as a special case of the first few terms of the Binomial Theorem. If you have not already (inductively) proved that, then we can easily prove this special case, viz.
$\!\begin{align}{\rm mod}\,\ \color{#c00}{a^3}\!:\,\  (1+ a)^n\, \ \  \equiv&\,\ \ 1 + na + n(n\!-\!1)/2\ a^2\qquad  {\rm i.e.}\ \ \color{darkorange}{P(n)}\\[.3em]
\Rightarrow\,\ \ (1+a)^{\color{}{n+1}}\! \equiv &\  (1 + na + n(n\!-\!1)/2\ a^2)(1 + \color{#0a0}a)\quad {\rm by}\ \ 1\!+\!a \ \ \rm times\ prior\\[.3em]
\equiv &\ \ 1\ \ \ +\,\ \ \ na + n(n\!-\!1)/2\ a^2\\[-.2em]
       &\ \ \ \ \ \ \  + \ \ \  \ 1\:\!\color{#0a0}a\ \ \ \ \ \ \ \,+\ \ \ \ \ \ n\,a\color{#0a0}a\ \ \ \ +\ \ \ \ n(n\!-\!1)n/2\ \color{#c00}{a^3}\\[.3em]
\equiv &\, \ 1\!+\! (n\!+\!1)a\!+\!n(n\!+\!1)/2\,a^2\ \ \ {\rm i.e.}\ \ \color{darkorange}{P({n\!+\!1})}\\[2pt]  
  \end{align}$
$\begin{align}\text{Thus for $\,a=3\,$ we get}\ \ 4^n &\equiv 1 + 3n + 9n(n-1)/2 \pmod{27}\\[.1em]
\Rightarrow\ \ 2\cdot 4^n &\equiv 2-3n+9n^2\qquad\quad\ \ \ \pmod{54}
\end{align}$
A: When $n$ is even, each term of $2^{2n+1} - 9n^2 + 3n -2$ is even. When $n$ is odd, $-9n^2 + 3n$ is odd + odd = even, hence $2^{2n+1} - 9n^2 + 3n -2$ is even.
Now $2 \cdot 4^{n} - 9n^2 + 3n -2 \equiv 2 \cdot 1^n - 2 \equiv 0 \pmod 3$. Now let $n = 3k$, so $2 \cdot 64^k - 9(3k)^2 + 9k - 2 \equiv$ $ 2\cdot 1^k - 9(3k)^2 + 9k - 2 \equiv 0 \pmod 9$. Letting $k = 9m$, $2 \cdot (64^9)^m - 9(9m)^2 + 81m - 2$ $ \equiv 2 \cdot 1^m - 9(9m)^2 + 81m - 2 \equiv 0 \pmod {27}$. This is because $\phi(27) = 27(1 - 1/3) = 18$, thus $64^{18} \equiv 1 \pmod {27} \implies 64^9 \equiv ±1 \pmod {27}$. But from before, $64^k \equiv 1 \pmod 9$ for $k \in \mathbb Z^+$, so it is congruent to $1$ and not $-1$.
