Prove by induction for $n\geq1, n \in \mathbb{N}$ $, 2^{2n+1}\equiv 9n^2-3n + 2\pmod{54}$. Question taken from the book by Andre Weil, titled Introductory number theory, chapter 5, question #V.3.
Prove by induction that, if $n$ is a positive integer, then
$2^{2n+1}\equiv 9n^2-3n + 2\pmod{54}$.
Take base case, $n=1, 2^3\equiv 9-3+ 2\pmod{54}$ $\implies  8\equiv 8\pmod{54}$.
So, the base case should be a value that yields LHS $\geq 54$.
$n=3, 2^7\equiv 9.9-3.3+ 2\pmod{54}$ $ \implies  128\equiv 81-9+2\pmod{54}$ $\implies 128\equiv 74\pmod{54}$ $\implies 20\equiv 20\pmod{54}$.
Assume, it is true for $n=k$, get:
$2^{2k+1}\equiv 9k^2-3k + 2\pmod{54}$.
Need show that it is true also for $n=k+1$.
$2^{2k+3}\equiv 9(k+1)^2-3(k+1) + 2\pmod{54}$
$\implies 2^{2k+1}.2^2\equiv 9(k)^2 +18k +9-3(k)-3 + 2\pmod{54}$
As LHS is proved, so need take the RHS, and show:
$\implies 9(k)^2 +18k +9-3(k)-3 + 2\equiv 9(k)^2 -3(k)+ 2 \pmod{54}$
$\implies 9(k)^2 +18k -3k +8 \equiv 9(k)^2 -3(k)+ 2 \pmod{54}$
$\implies 18k +6 \equiv 0 \pmod{54}$
$\implies 3k +1 \equiv 0 \pmod{9}$
Why got such a wrong result?
Alternatively if induction is not mandatory, $$2^{2n+1}-2=2(4^n-1)$$
$$(1+3)^n-1\equiv\binom n13^1+\binom n23^2\pmod{27}\equiv\dfrac{9n^2-3n}2 $$
$$\implies2(4^n-1)\equiv9n^2-3n\pmod{54}$$
Hint:
$$2^{2(n+1)+1} -(9(n+1)^2-3(n+1)+2)$$
$$\equiv36n^2-12n-8-(9n^2+18n+9-3n-3+2)$$
$$\equiv27n(n-1)$$
$$\equiv0\pmod{2\cdot27}$$