@RealEyes,
To finish up what engineer so nicely started...
L-m must be a multiple of 4.
Therefore, you're looking for solutions to:
2^m(16^x - 1) = n*10^k, 1 <= n <= 13
Let's eliminate all powers of 2 from both sides:
16^x - 1 = n*5^k, n = 1, 3, 5, 7, 9, 11, 13
16^x = (4^x)^2; so we have:
(4^x)^2 - 1 = n*5^k, n = 1, 3, 5, 7, 9, 11, 13
The expression on the left is the difference of two squares. Therefore, it can be rewritten as:
(4^x - 1)(4^x + 1) = n*5^k, n = 1, 3, 5, 7, 9, 11, 13
4^x - 1 and 4^x + 1 can't both be multiples of 5 since they differ by 2. Therefore, the left side contains a factor that is not a multiple of 5 and is at least 4^x - 1.
The problem requires that that factor be no greater than 13, which means x must be less than 2 (since 4^2 - 1 = 15).
The bottom line is that your search is over. You don't need to consider differences (L-m) greater than 4.