In this question it was asked whether there exist integer solutions to the equation
$$|2^m-3^n|=35,$$
and I responded by saying that, modulo $85$, there do not exist any integer solutions to
$$2^m - 3^n \equiv \pm 35,$$
so there are no solutions to the equation itself. I'd originally seen a problem on a contest asking contestants to find the smallest prime that is not a value of $$|2^m-3^n|,$$
and it was solved by finding values for the primes $2,3,5,7,11,13,17,19,23,29,31,$ and $37$, and proving (via mod-bashing) that there does not exist a solution at $41$.
My question is: For every integer $k$, does there either exist integers $m,n$ such that
$$|2^m-3^n|=k,$$
or an integer $M$ such that
$$2^m-3^n \equiv \pm k \bmod M,$$
and if so, is there a simple way to find $M$ (assuming there don't exist $m,n$)?
I've attached a table that shows, for each $k\leq 100$, whether there exists a solution, and if not, what the smallest modulus that can be used is, in case it's useful to anyone. The sequence doesn't seem to exist on OEIS.
1 is a value of |2^m-3^n| . 2 is a value of |2^m-3^n| . 3 is a value of |2^m-3^n| . 4 is solved by the modulus 8. 5 is a value of |2^m-3^n| .
6 is solved by the modulus 12. 7 is a value of |2^m-3^n| . 8 is a value of |2^m-3^n| . 9 is solved by the modulus 15. 10 is solved by the modulus 20.
11 is a value of |2^m-3^n| . 12 is solved by the modulus 8. 13 is a value of |2^m-3^n| . 14 is solved by the modulus 18. 15 is a value of |2^m-3^n| .
16 is solved by the modulus 20. 17 is a value of |2^m-3^n| . 18 is solved by the modulus 12. 19 is a value of |2^m-3^n| . 20 is solved by the modulus 8.
21 is solved by the modulus 15. 22 is solved by the modulus 18. 23 is a value of |2^m-3^n| . 24 is solved by the modulus 15. 25 is a value of |2^m-3^n| .
26 is a value of |2^m-3^n| . 27 is solved by the modulus 33. 28 is solved by the modulus 8. 29 is a value of |2^m-3^n| . 30 is solved by the modulus 12.
31 is a value of |2^m-3^n| . 32 is solved by the modulus 18. 33 is solved by the modulus 21. 34 is solved by the modulus 22. 35 is solved by the modulus 85.
36 is solved by the modulus 8. 37 is a value of |2^m-3^n| . 38 is solved by the modulus 22. 39 is solved by the modulus 15. 40 is solved by the modulus 18.
41 is solved by the modulus 91. 42 is solved by the modulus 12. 43 is solved by the modulus 195. 44 is solved by the modulus 8. 45 is solved by the modulus 33.
46 is solved by the modulus 26. 47 is a value of |2^m-3^n| . 48 is solved by the modulus 18. 49 is a value of |2^m-3^n| . 50 is solved by the modulus 18.
51 is solved by the modulus 15. 52 is solved by the modulus 8. 53 is solved by the modulus 80. 54 is solved by the modulus 12. 55 is a value of |2^m-3^n| .
56 is solved by the modulus 20. 57 is solved by the modulus 48. 58 is solved by the modulus 18. 59 is solved by the modulus 240. 60 is solved by the modulus 8.
61 is a value of |2^m-3^n| . 62 is solved by the modulus 24. 63 is a value of |2^m-3^n| . 64 is solved by the modulus 20. 65 is a value of |2^m-3^n| .
66 is solved by the modulus 12. 67 is solved by the modulus 120. 68 is solved by the modulus 8. 69 is solved by the modulus 15. 70 is solved by the modulus 20.
71 is solved by the modulus 80. 72 is solved by the modulus 21. 73 is a value of |2^m-3^n| . 74 is solved by the modulus 26. 75 is solved by the modulus 21.
76 is solved by the modulus 8. 77 is a value of |2^m-3^n| . 78 is solved by the modulus 12. 79 is a value of |2^m-3^n| . 80 is a value of |2^m-3^n| .
81 is solved by the modulus 15. 82 is solved by the modulus 22. 83 is solved by the modulus 117. 84 is solved by the modulus 8. 85 is solved by the modulus 91.
86 is solved by the modulus 18. 87 is solved by the modulus 33. 88 is solved by the modulus 26. 89 is solved by the modulus 80. 90 is solved by the modulus 12.
91 is solved by the modulus 195. 92 is solved by the modulus 8. 93 is solved by the modulus 21. 94 is solved by the modulus 18. 95 is solved by the modulus 85.
96 is solved by the modulus 15. 97 is solved by the modulus 91. 98 is solved by the modulus 22. 99 is solved by the modulus 15. 100 is solved by the modulus 8.