Modular arithmetic $(2n+1)x \equiv -7 \pmod 9$ Find a solution $(2n+1)x \equiv -7 \pmod 9$
I’m sure this is trivial but I still have doubts about it.
I know the equation has solution for certain $n \in \mathbb {Z}$. Actually I have tried a few and got a similar results (with Diophantine equations ). I wonder if there’s general solution for the equation without changing the n for an integer.
Thanks in advance.

Since $2n + 1$ 'cycles through' the modulo $9$ residues, the problem is reduced to solving
$$\tag 1 x'x \equiv 2 \pmod 9$$
This is equivalent to $x'x = 9k +2$ and we need only look for solutions
$$ 0 \le x' \lt 9 \text{ and } 0 \le x \lt 9$$
We represent both $x'$ and $x$ in $\text{base-}3$ format,
$$\tag 2  x' = a' + b'3 \text{ and } x = a + b3 \quad \text{with } a',b',a,b \in \{0,1,2\}$$
Multiplying,
$$ x'x = a'a + (a'b+ab')3 + bb'3^2$$
Since $a'a + (a'b+ab')3 \le 28 \lt 29 = 2 + 3 \times 9$, we segment the work into 3 parts.
Part 1:  $a'a + (a'b+ab')3 = 2$
$\quad$ Ans: [$x' = 1$ and $x = 2$] OR [$x = 1$ and $x' = 2$]
Part 2:  $a'a + (a'b+ab')3 = 11$
$\quad$ Ans: [$x' = 4$ and $x = 5$] OR [$x = 4$ and $x' = 5$]
Part 3:  $a'a + (a'b+ab')3 = 20$
$\quad$ Ans: [$x' = 7$ and $x = 8$] OR [$x = 7$ and $x' = 8$]
We only work out the details for Part 3:
Since $3 \nmid 20$, $\,3 \nmid 19$ and $3 \nmid 16$, if we have any solutions at all we must have
$\quad a'a = 2$
$\quad (a'b+ab') = 6$
If we set $a' = 2$ and $a = 1$ we get $2b + b' = 6$. So $b = 2$ and $b' =2$. So $x' = 2 + 2 \times 3 = 8$ and $x = 1 + 2 \times 3 = 7$. Up to an interchange, there can be no other solutions.
