------
## 最终结论
```python
def min_operations(x, target):
    from functools import lru_cache

    @lru_cache(None)
    def dp(target):
        if target == 0:
            return 0
        if target == 1:
            return 1

        res = float('inf')
        power = x
        count = 0

        while power <= target:
            count += 1
            if power == target:
                return count

            # Option 1: Use the current power of x
            res = min(res, count + dp(target - power) + 1)

            # Option 2: Go beyond the target and then subtract back
            res = min(res, count + dp(power - target) + 1)

            power *= x

        # If we are here, it means power > target
        # We can try to subtract back from the next power of x
        res = min(res, count + dp(target) + 1)

        return res

    return dp(target)
```