Solve $2^x=3^y+509$ over positive integers. My solution is as follows: $$\begin{align*}2^x=3^y+509&\Longrightarrow 2^x-512=3^y+509-512\\&\Longrightarrow 2^x-2^9=3^y-3\\&\Longrightarrow 2^9(2^{x-9}-1)=3(3^{y-1}-1)\\&\Longrightarrow (x,~y)={(9,~1)}\end{align*}$$ but how can I see that this the only solution?
$(2^x-1)509=3(3^y-2^x)$ and $509$ and $3$ prime then for any $k\in\mathbb{Z^+}$, $2^x=3k+1$, $3^y-2^x=509k$ so $3^y=512k+1$ but I can't show that there is no solution for this equation for $y>1.$
Another approach: For modulo 9 if we accept there is a solution to $y\ge2$ so $2^x\equiv 5\mod 9$ hence $x=6k+5$ and x must be an odd number.