There is a number, the second digit of which is smaller than its first digit by 4, and if the number There is a number, the second digit of which is smaller than its first digit by 4, and if the number was divided by the digit's sum, the remainder would be 7.
Actually I know the answer is 623
I found it by using computer program which checks the conditions for all numbers but I wanted to know if there is a mathematical way to slove this problem.

You have $6$ possibilities for the two first digits:  $a_1a_2=40,51,62,73,84,95$ and you can verify that the number cannot have two digits. Then you try with $3$ digits keeping in mind that the number minus $7$ is a multiple of $a_1+a_2+a_3$ so you have
$$\frac{a_1a_2a_3-7}{a_1+a_2+a_3}=entero$$
(1) $\dfrac{400+a_3-7}{4+a_3}=\dfrac{393+a_3}{4+a_3}$.  You have to verify with the nine possible values of $a_3$; in other words you must to see if some of the nine following quotiens is an integer:
$$\dfrac{393}{4},\dfrac{394}{5},\dfrac{395}{6},\dfrac{396}{7},\dfrac{397}{8},\cdots,\dfrac{402}{13}$$
(2)Proving now with $51a_3$ you find $\dfrac{510+a_3-7}{6+a_3}=\dfrac{503+a_3}{6+a_3}$ and
for $a_3=1$ you find an apparent solution since $\dfrac{504}{7}=72$. However the number $511$ is exactement divisible by $5+1+1$ so it must be discarded.
(3) Proving with $62a_3$ by the same procedure you'll find your given solution $623$.
