I'm looking at the following programming puzzle:
Here's a summary of the problem:
An integer $d$ is "beautiful" w/respect to $k$ if
$$d - \operatorname{reverse}(d) \equiv 0\pmod{k}$$
where $\operatorname{reverse}(d)$ is the integer produced if the base-$10$ representation of $d$ were reversed; here's some examples: $$\begin{align*} \operatorname{reverse}(123) & & & = 321 \\ \operatorname{reverse}(200) & & & = 2 \\ \operatorname{reverse}(2) & & & = 2 \end{align*}$$
Given integer inputs:
- $1 \le x \le y \le 2 \cdot 10^6$
- $1 \le k \le 2 \cdot 10^9$
... write a function that counts the number of beautiful numbers $d$ in $x \le d \le y$.
The solutions I've seen are equivalent to the following:
- Define: $$\operatorname{reverse}(x) \ := \ \sum_{k=0}^n 10^{k}\left(\left\lfloor{\frac{x}{10^{n-k-1}}}\right\rfloor \bmod 10\right)$$
- Test: $$x - \operatorname{reverse}(x)\equiv 0 \pmod{k}$$
Initially I figured this was one of those "it's easy if you know the trick" problems, however after toying with it I don't believe there is any such shortcut.
How can I prove this problem doesn't have a trivial solution?