Number of coprime solutions to a diophantine equation

265 Views Asked by At

If we are given a diophantine equation of the form a+b+c = 30 (say) and we need to find the number of positive integer solutions, we can say that the answer would be $29\choose2$.

If we were to find out the number of solutions in which a.b.c were coprime to each other or GCD(a,b,c)=1 . How do you proceed?

I mean one can proceed to find solutions in which any two are equal say {14,14,2} or {1,1,28} and say there are 14 such selections or 3 times 14 solutions. Or we can start with saying that, among the $29\choose2$ solutions such that gcd(a,b,c)=2 are included so we subtract those which come out to be solutions of a1+b1+c1=15. But here as well some solutions will have to be discarded.

This is something I came up randomly, is there an ordered( nice) way of doing this math since I might miss a lot of cases.

Thanks

2

There are 2 best solutions below

0
On

$\gcd(a,b,c)$ is one of the numbers $1,2,3,5,6,10,15,30$ and you can handle each of these possibilities the same way you handled $\gcd(a,b,c)=2$, namely, divide through by the gcd and find the number of solutions of $a+b+c=30/d$. You'll have to apply the Principal of Inclusion-Exclusion so that you don't do any double-counting.

0
On

Call $S(n)$ the number of (positive) solutions to $a+b+c = n$ and $S(n, d)$ the number of (positive) solutions to $a+b+c = S$ where $\gcd(a, b, c) = d$. Then $$S(n) = \sum_{d \mid n} S(n, d) = \sum_{d \mid n} S(n/d, 1)$$ By Möbius-inversion (inclusion-exclusion in disguise): $$\begin{align*} S(n, 1) &= \sum_{d \mid n} \mu(d) S(n/d) \\ &= \sum_{d \mid n} \mu(d) \binom{\frac n d -1}2 \end{align*}$$ You want $S(30, 1)$.