Determine all positive integers $m$ such that the ratios $$ \frac{2(5^m+5)}{3^m+1}\quad\text{and}\quad \frac{9^m+1}{5^m+5}$$ are both integers.
Attempt at a solution:
If the ratios are both integers, then their product is also an integer; this means that $$\frac{2(5^m+5)}{3^m+1}\cdot \frac{9^m+1}{5^m+5}=\frac{2(3^{2m}+1)}{3^m+1}$$ is also an integer. Let $x=3^m$. We find the values of $x$ such that $$\frac{2(x^2+1)}{x+1}$$ is an integer. Using euclidean division, we find that $$2(x^2+1)=(2x-2)(x+1)+4.$$ Dividing both sides by $x+1$, we find that $$\frac{2(x^2+1)}{x+1}=2x-2+\frac{4}{x+1}.$$ For the LHS to be an integer, the RHS must be an integer as well. Obviously $2x-2$ is an integer, and therefore $4/(x+1)$ must be an integer as well; that is, $x+1$ divides $4$. The only possible values of $x+1$ are therefore $4, 2, 1, -1, -2$ and $-4$. But the only acceptable value of $x$ is $3$, since it can't be negative or zero and must be divisible by three, being a positive power of three. In conclusion, $3^m=3 \implies m=1$. We verify that $m=1$ is indeed a solution, hence the only one.
I'm quite positive about the correctness of the solution, but I'd like to hear (constructive!) criticism about the way I wrote it. When I write a solution I always feel like I'm not properly justifying all the steps.