I want to find the smallest integer $x$ which satisfies the following condition.
$x \times 29$ and delete the first and last digit, it produces $x$
Using python, I made some code and figure out the answer is $52631579 \times 29 = 1526315791$.
I have trouble writing this in a formal way. I mean setting up equations and solving variables. How one can show $x=52631579$ without trial and error?
The smallest number satisfying the given condition is in fact $x=53$ ($29x=1537$). Here is how to find it.
If $29x=\overline{ax_1x_2\dots x_k b}$ and $x=\overline{x_1x_2\dots x_k}$, it follows by shifting and subtraction that $19x=\overline{a00\dots0b}$. Since $19x$ has two more digits than $x$, the first two digits of $19x$ have to form a number strictly lower than $19$, and so $a=1$.
We now check the residues $10^k\bmod19$ from $k=2$ onwards (since $k=1$ would lead to $x$ having no digits). For $k=2$ we get a residue of $5$, and no digit $b$ can be added to it to make the residue $0$, which would give us the number $x=\overline{100\dots0b}/19$. For $k=3$ the residue is $12$ and we can take $b=7$, so $x=1007/19=53$ as above.