I'm trying to solve the following equation: $7x\equiv5 \pmod {256}$
My attempt:
$7x\equiv5 \pmod {256}$
$7x-5=256y$
$7x-256y=5$
Next, find the $gcd(7,256)$
$256=36*7+4$
$7=1*4+3$
$4=1*3+1$
$3=1*3 \Longrightarrow gcd(7,256)=1$
Then, find $x$ and $y$ in $7x-256y=5$
$1=4-3$
$1=256-36*7-(7-4)$
$1=256-36*7-7+(256-36*7)$
$1=256-37*7+256-36*7$
$1=7*(-73)+256*2$
$5=7*(-365)+256*10 \Longrightarrow x_0=-365, y_0=10$
Therefore, the solution to the Diophantine equation is $\begin{equation} \begin{cases} x=-365+n*\frac{-256}{1}=-256n-365\\ y=10-n*\frac{7}{1}=10-7n \end{cases} \end{equation}$
Which in turn means that the solution to $7x\equiv5 \pmod {256}$ is
$-256n-365, n\in \mathbb{Z}$. But my answer sheet and WolframAlpha give the solution $x=256n+147$. What am I missing?