Find the integer : $x \times 29$ and delete the first and last digit, it produces $x$ 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? 
 A: 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.
A: COMMENT.- Unfortunately the correct minimum has already given above. I deduce it another way.
►Clearly $x$ can not be a digit (see the products $29x$).
► Searching for $x=10a+b$ we have $29x=290a+29b$. Discarding $(a,b)=(0,0)$ we plot the $18$ involved numbers:
$$290\hspace{15 mm}29\\580\hspace{15 mm}58\\870\hspace{15 mm}87\\1160\hspace{15 mm}116\\1450\hspace{15 mm}145\\1740\hspace{15 mm}174\\2030\hspace{15 mm}203\\2320\hspace{15 mm}232\\2610\hspace{15 mm}261$$  Taking modulo $10$ at first glance we can verify what one $(a,b)$ suits as candidates to consider so we have nine possibilities
$$(a,b)\in\{(1,1),(3,2),(5,3),(7,4),(9,5),(1,6),(3,7),(5,8),(7,9)\}$$
Among them only $(5,3)$ is verified with the sum $1450+87=1537$.
Thus the required minimum have two digits and is $x=53$.
