<s>[INST] Find when $\frac{3^n+6^n+9^n}{3^{n-1}+6^{n-1}+9^{n-1}}$ is an integer 
Find all natural numbers $n$ such that $$\dfrac{3^n+6^n+9^n}{3^{n-1}+6^{n-1}+9^{n-1}}$$ is an integer.

For $n = 1$ we have $\dfrac{18}{3} = 6$.
For $n = 2$ we have $\dfrac{126}{18} = 7$.
For $n = 3$ we have $\dfrac{972}{126} = \dfrac{54}{7}$
For $n = 4$ we have $\dfrac{7938}{972} = \dfrac{49}{6}$.
I don't seem to find any other integers for the fraction for $n > 2$. How can we find all of the $n$ such that it is an integer?
 [/INST] $\begin{array}\\
\dfrac{3^n+6^n+9^n}{3^{n-1}+6^{n-1}+9^{n-1}}
&=\dfrac{3^n+6^n+9^n}{3^{n-1}+6^{n-1}+9^{n-1}}-9+9\\
&=\dfrac{3^n+6^n+9^n-9(3^{n-1}+6^{n-1}+9^{n-1})}{3^{n-1}+6^{n-1}+9^{n-1}}+9\\
&=\dfrac{3^n+6^n+9^n-9\cdot 3^{n-1}-9\cdot 6^{n-1}-9^{n}}{3^{n-1}+6^{n-1}+9^{n-1}}+9\\
&=\dfrac{3^n+6^n-9\cdot 3^{n-1}-9\cdot 6^{n-1}}{3^{n-1}+6^{n-1}+9^{n-1}}+9\\
&=\dfrac{3^n+6^n- 3^{n+1}-\frac23  6^{n}}{3^{n-1}+6^{n-1}+9^{n-1}}+9\\
&=\dfrac{\frac13 6^n-2\cdot 3^{n}}{3^{n-1}+6^{n-1}+9^{n-1}}+9\\
&=\dfrac{3\cdot (2/3)^{n-1}-9\cdot (1/3)^{n-1}}{(1/3)^{n-1}+(2/3)^{n-1}+1}+9\\
\end{array}
$
For
$n \ge 3$,
$0 \lt 3\cdot (2/3)^{n-1}-9\cdot (1/3)^{n-1}
\lt 1$,
so this is never an integer
for $n \ge 2$.
</s>