Number of Solutions How to to calculate the number of solutions for the equation 
$A+B-\gcd(A,B)=R$
where we are given $R$ in the question ?
In this question we have to calculate the number of combinations of $A$ and $B$ which satisfies this equation. 
 A: For any divisor $g$ of $R$ you get a solution $(a+b-1)g=ag+bg-g=R$ for $a,b$ coprime. So we are interested in the number of ways you can write $\frac{R}{g}+1$ as a sum of coprime numbers. 
Since $\gcd(a,b)=\gcd(a,a+b)=\gcd(a,\frac{R}{g}+1)$ there are $\varphi(\frac{R}{g}+1)$ ways to do so (where $\varphi$ denotes Euler's totient function). Thus the answer is $$\sum_{d\mid R} \varphi(d+1)$$
A: If I follow benh's logic correctly, then his answer is double counting (almost) all of the solutions. This would be a comment on his answer, but I fail the rep requirement and it turned out too long and detailed anyway.
Let $ f = \frac{R}{g} $
$ \gcd(a, f + 1) = 1. $ Thus if $ c > 1 $ divides a, it does not divide $ f + 1 $.
Let $ c > 1 $ divide a. Then c does not divide $ f+1 -a = b $, hence a and b are coprime if either of them is coprime with $ f+1 $.
Thus the conclusion follows that naturals less than and coprime with $ f + 1 $ correspond to solutions. But consider when $ a = f + 1 -k $. This forces $ b = k $, which gives an identical solution to when a is chosen as k, forcing $ b = f + 1 -k $. This means that any solution where $ a \not = f + 1 - a $ is being double counted.
$ a = f + 1 - a \implies f+1 = a + a \implies b = a$
Positive $ b = a $ are coprime only when $ b = a = 1 $, hence every case except for one solution is being double counted.
It then follows that the number of solutions is:
$$\frac{1 + \sum\limits_{d|R}\varphi(d+1)}{2}$$
