Whenever you have $a^x\equiv b\pmod{n}$ it all depends whether $n$ is prime or composed.
In case $n$ is composed you can reduce the problem by using little Fermat theorem.
e.g. if $n=pq$ then you get the system
$\begin{cases}
a^{x}\pmod{p}\equiv(a\pmod{p})^{x\pmod{p-1}}\pmod{p}\equiv {a_1}^{x_1}\pmod{p}\\
a^{x}\pmod{q}\equiv(a\pmod{q})^{x\pmod{q-1}}\pmod{q}\equiv {a_2}^{x_2}\pmod{q}\end{cases}$
In our case, since $2$ is small already, $a=a_1=a_2=2$ do not change, but since $p,q$ are smaller you get less tries to perform to search for $x_1$ and $x_2$.
Once you get them, you can apply LCM or CRT to get $x$.
Unfortunately for prime numbers $p$, you cannot reduce further and if they are large, then you get to try all values.
There are however algorithms like baby-step giant-step to achieve discrete logarithm, but these are not easy and straightforward:
https://en.wikipedia.org/wiki/Discrete_logarithm
2^x = 2704 mod 54065406 -> 2 * 3 * 17 * 53 (p = 102; n = 53 for example)$\begin{cases} 2^{x}\pmod{102}\equiv(2\pmod{102})^{x\pmod{101}}\pmod{102}\equiv 1\ 2^{x}\pmod{53}\equiv(2\pmod{53})^{x\pmod{52}}\pmod{53}\equiv 8\ 2^{x1}\pmod{102}\equiv 1\ 2^{x2}\pmod{53}\equiv 8\\end{cases}$
102 is not prime so I recursively continue solving? And stop for 53 since its prime? So I get basically equation for each prime in n and solve each one and find LCM for those numbers?
– eXPRESS Dec 25 '18 at 14:01