Finding Distant Primes Let us call a prime \$p\$ an \$(m,k)\$-distant prime \$(m \ge 0, k \ge 1, m,k \in\mathbb{Z})\$ if there exists a power of \$k\$, say \$k^x (x \ge 0, x \in\mathbb{Z})\$, such that \$|k^x-p| = m. \$ For example, \$23\$ is a \$(9,2)\$-distant prime as \$|2^5 - 23| = 9\$. In other words, any prime which is at a distance of \$m\$ from some non-negative power of \$k\$ is an \$(m,k)\$-distant prime.
For this challenge, you can either:

Take input three integers \$n, m, k\; (n,k \ge1, m \ge0)\$ and print the \$n^{th}\$ \$(m,k)\$-distant prime. You do not need to handle inputs where answer does not exist. You can take \$n\$ as zero-indexed if you want.
Take \$n, m, k\$ as input and print the first \$n\$ \$(m,k)\$-distant primes.
Or, take only \$m\$ and \$k\$ as input and print all \$(m,k)\$-distant primes. It is fine if your program runs infinitely and does not terminate if there aren't any \$(m,k)\$-distant primes, or all such primes have already been printed.

Examples
m,k    -&gt; (m,k)-distant primes
1,1    -&gt; 2
0,2    -&gt; 2
1,2    -&gt; 2, 3, 5, 7, 17, 31, 127, 257, 8191, 65537, 131071, 524287, ...
2,2    -&gt; 2, 3
2,3    -&gt; 3, 5, 7, 11, 29, 79, 83, 241, 727, 6563, 19681, 59051
3,2    -&gt; 5, 7, 11, 13, 19, 29, 61, 67, 131, 509, 1021, 4093, 4099, 16381, 32771, 65539, 262147, ...
20,2   -&gt; None
33,6   -&gt; 3
37,2   -&gt; 41, 53, 101, 293, 1061, 2011, 4133, 16421, ...
20,3   -&gt; 7, 23, 29, 47, 61, 101, 223, 263, 709, 2207, 6581, 59029, 59069, 177127, 177167
20,7   -&gt; 29, 2381, 16787
110,89 -&gt; 199, 705079

Rules

Standard loopholes are forbidden.
You may choose to write functions instead of programs.
This is code-golf, so the shortest code (in bytes) wins.
JavaScript (ES6), 103 bytes
Expects (m)(k)(n) and returns the \$n\$-th \$(m,k)\$-distant prime (1-indexed).

m=&gt;k=&gt;F=(n,p)=&gt;(g=d=&gt;p%--d?g(d):d^1)(p)|(g=(n,K=1)=&gt;K&gt;n||K&lt;n&amp;k&gt;1&amp;&amp;g(n,K*k))(p+m)*g(p-m)||--n?F(n,-~p):p

Try it online!
Commented
m =&gt; k =&gt;            // outer functions taking m and k
F = (n, p) =&gt;        // inner recursive function taking n
(                    // and using p = current prime candidate
  g = d =&gt;           // g is a recursive function taking a divisor d
    p % --d ? g(d)   //   decrement d until it divides p
            : d ^ 1  //   return a truthy value if p is composite
)(p) |               // initial call to g with d = p
(                    //
  g = (n,            // g is a recursive function taking n = p + m or p - m
          K = 1) =&gt;  // and K = k ** x
    K &gt; n ||         //   if K is greater than n
    K &lt; n &amp; k &gt; 1 &amp;&amp; //   or K is less than n and k is greater than 1:
      g(n, K * k)    //     do a recursive call with k raised to the next exponent
)(p + m) *           // unless the above function is truthy for p + m ...
g(p - m)             // ... and for p - m (meaning that we don't have |k**x-p|=m)
                     // or p was composite:
|| --n               //   decrement n
?                    // if all of the above is truthy:
  F(n, -~p)          //   try again with p + 1
:                    // else:
  p                  //   success: return p