I was working on a programming problem that eventually reduced to solving the inverse of the following:

$$y \equiv (x \times 2^k )\pmod{p}$$

for $x$, $k$, $p$, $y \in \mathbb{N}$ , $x$ < $p$, and $p$ is prime.

Given that I know $k$, $y$, and $p$, I had to solve for $x$.

I was able to solve the problem by repeatedly dividing by two $k$ times (adding $p$ before doing the division if the number was odd). My real question is if there was a better solution that I wasn't clever enough to figure out.