Consider the diophantine equation $\frac 1 a + \frac 1 b = \frac p {10^n}$ with $a, b, p, n$ positive integers and $a \le b$.
For $n=1$ this equation has $20$ solutions that are listed below:
\begin{matrix}
\frac 1 1 + \frac 1 1 = \frac{20}{10} & \frac 1 1 + \frac 1 2 = \frac{15}{10} & \frac 1 1 + \frac 1 5 = \frac{12}{10} & \frac 1 1 + \frac 1 {10} = \frac{11}{10} & \frac 1 2 + \frac 1 2 = \frac{10}{10}\\
\frac 1 2 + \frac 1 5 = \frac 7 {10} & \frac 1 2 + \frac 1 {10} = \frac 6 {10} & \frac 1 3 + \frac 1 6 = \frac 5 {10} & \frac 1 3 + \frac 1 {15} = \frac 4 {10} & \frac 1 4 + \frac 1 4 = \frac 5 {10}\\
\frac 1 4 + \frac 1 {20} = \frac 3 {10} & \frac 1 5 + \frac 1 5 = \frac 4 {10} & \frac 1 5 + \frac 1 {10} = \frac 3 {10} & \frac 1 6 + \frac 1 {30} = \frac 2 {10} & \frac 1 {10} + \frac 1 {10} = \frac 2 {10}\\
\frac 1 {11} + \frac 1 {110} = \frac 1 {10} & \frac 1 {12} + \frac 1 {60} = \frac 1 {10} & \frac 1 {14} + \frac 1 {35} = \frac 1 {10} & \frac 1 {15} + \frac 1 {30} = \frac 1 {10} & \frac 1 {20} + \frac 1 {20} = \frac 1 {10}
\end{matrix}
How many solutions has this equation for $1 \le n \le 9$?
The given Diophantine equation can be written as
\[10^n(a+b)=abp \tag{1}\]
First, let’s notice that $a$ and $b$ can’t be multiples of 10, because the left-hand side of equation (1) would be divisible by $10^n$ and the right-hand side would not be divisible by $10^n$.
Since the critical observation is that given (a,b,p,n), you can generate different (a,b,p,n) simply by multiplying (a,b,p) by a power of 10, we can focus on the ‘base’ solutions where a, b, and p are not divisible by 10. For a base solution (a,b,p), when multiplied by 10^(n-1), you will generate a solution for each value of n up to the total number of digits in a*b*p.
Based on above, we can classify the ‘base’ solutions into five categories:
1) a=b=p=1. This gives (a,b,p,n) = (10,10,1,1), (100,100,1,2)… up to n=10
2) a=1,b=p=10. This gives (a,b,p,n) = (10,10,10,1), (100,100,10,2) … up to n=10
3) a=1,p=2,b=5. This gives (a,b,p,n) = (10,50,2,2), (100,500,2,3) … up to n=9
4) a=1,b=2,p=5. This gives (a,b,p,n) = (10,20,5,2), (100,200,5,3) … up to n=9
5) a=1,b=p=5. This gives (a,b,p,n) = (10,50,5,2), (100,500,5,3) … up to n=9
Each ‘base’ solution generates a string of solutions of various n, up to the total number of digits in a*b*p for that ‘base’ solution.
Thus, the total number of solutions is calculated by adding up the number of solutions generated by each ‘base’ solution:
For n in range 1-9, the ‘base’ solution generates (10-n) solutions.
1) generates (10-1) + (10-2) + … + (10-10) = 45 solutions
2) generates (10-1) + (10-2) + … + (10-10) = 45 solutions
3) generates (10-2) + (10-3) + … + (10-9) = 36 solutions
4) generates (10-2) + (10-3) + … + (10-9) = 36 solutions
5) generates (10-2) + (10-3) + … + (10-9) = 36 solutions
Adding up these quantities gives a total of 198 solutions.
More Answers:
Exploring Pascal’s PyramidCounting Capacitor Circuits
Counting Digits