$X$ is supposed to be the duration of the loan in years.
The number $0.02$ stands for the nominal interest and the $1.0161$ stands for the compound interest + $1$.
The equation can also be written : $(1 + X/50)^{1/X} = 1.0161$
To use the right logarithm for this is difficult but is it possible to solve?
For example with $\log [(1+0,02x)^{1/x}] = \log (1,0161)$.
Or with $1/x \cdot \log (1+ 0,02x) = \log (1,0161)$
Or with $\ln$?