How to find the difference between the son's and mother's age if it(ages of son and mother) is reversible for a total of 8 times? There is a quiz question for which I need to write a python code. I don't need help for the code but this is what I need help with.
A son had recently visited his mom and found out that the two digits that form his age (eg :24) when reversed form his mother's age (eg: 42). Later he goes back to his place and finds out that this whole 'age' reversed process occurs 6 times. And if they (mom + son) were lucky it would happen again in future for two more times.
So we have a total of 8 times when this would occur. The actual question is how old is the son at present ? I don't need help with that , I am trying to figure out the age difference which in turn will lead to me the present age and based on that I could write my code.
Observation: If you take any two-digit number and switch the digits, the
difference between the two numbers is a multiple of 9.In particular, the difference is 9 times the difference between the two digits.
But how do I figure out this age difference ?

The first time it happen was when the son was $10a  + b$ and then mother was $10b + a$.  In $k$ years it happened again and the son was $10a + b+k$ and then mother was $10b + a + k$.
Case 1:  $b+k$ and $a+k$ are both under $10$
Then $a+k =a$ and $b+k = b$ and $k =0$.  That's .... a loophole. The implicit assumption was $k > 0$.
Case 2:  $b+k \ge 10$ but $a + k < 10$ so $k \le 9$ and $b+k \le 19$.  So the son is $10(a+1) + (b+k-10)$ and the mother is $10b + (a+k)$ and $a+k = a+1$ and $(b+k-10) =b$ so $k=1$ and $k=10$.  That's impossible.
Case 3: $b+k < 10$ but $a+ k \ge 10$.  Same problem as Case 2.  $(a+k-10)=a$ but $b+1 = b+k$.
Case 4:  $b+k \ge 10$ and $a+k \ge 10$.
Case 4a:  There is a $j$ so that $10j \le b+k < 10(j+1)$ and $10j \le a+k < 10(j+1)$
Son is $10(a+j) + (b+k-10j)$ and Mother is $10(b+k) + (a+k-10j)$ so $a+j = a+k-10j$ and $k = 11j$.
Now a bit of common sense: This can not proceed to three digits.  The reverse of $1xy$ is $yx1$ and we can assume $200$ is beyond the range of human longevity.  So if the son is the reverse of a three digit mother, then they are both $1x1$ and are the same age which is obviously impossible.
SO for this to occur $8$ times $j$ must be $1$.
For this to occur $8$ times then $8$th time we will have the son $10a+b+77$ and the mother is $10b+a+77$ and as we can never have a Case 2: or Case 3 we need $a+7 < 10$ and $b+7<10$ So $a<3$ and $b< 3$.  As the mother is older $b > a$.  So if $b=2$ and $a=1$ then the mother was $21$ and the boy was $12$ and that is just plain GROSS!!!!
So I'm guessing a first digit of $0$ has to be acceptable.  So this occurred at when the son was $2$ and the mother was $20$.
....
To really complete this I should consinder $b+k < 10j \le a+k$ (and vice versa)
And we should also consider that in $k$ years and some months. That the son (or mother) may have had $k$ birthdays the other could have had $k+1$ birthdays.
