I'm working on a cryptography programming puzzle. I've worked out that the basic formula to generate a character is $$(x \cdot 2^i)\bmod 67 = character.$$
In order to decode, I need to work out what are the possible values for x, with $1 \leq x \leq 67$.
Here are some example equations and their solutions from WolframAlpha:
$2x \bmod 67 = 1 \implies x = 67n +34$
$4x \bmod 67 = 20\implies x = 67n + 5$
$8x \bmod 67 = 29\implies x = 67n + 12$
I want to understand what steps WolframAlpha is doing: How do I take the forms on the left and put them in the forms on the right?
This post on StackOverflow was helpful, but I didn't understand it well enough to generalize the approach. I studied some modular arithmetic, couldn't find the part that would help me here.