Let $Q(L)$ be the number of pairs of numbers $m , n$ such that $gcd(m,n) = 1$ and $m$ and $n$ are of different pairity, where $m$ is even and $n$ is odd, and $m^2 + n^2$ $\le$ $ L$.
$$Q(L) = \sum_{gcd(m,n)=1 \atop {m\space even\atop {n\space odd}}}^{m^2+n^2 \le L}1$$
The number of these pairs corresponds to the number of primitive pythagorean triplets with a hypotenuse $\le$ $L$, in which $gcd(a,b,c) = 1$ and $a,b,c$ are the sides of the triangle.
If $L$ is small I can easily enumerate the number of these pairs with a computer, but given sufficiently large $L$ this becomes inefficient. I've been thinking for quite some time but I couldn't myself find a formula or an algorithm, though I have a feeling there is a simple combinatorial approach to this. So is there an efficient way to count these pairs?
EDIT
In an attempt to solve the above question, I've come up with an idea to perhaps simplify it. Define $T(P,L)$ to be the amount of numbers $\le$ $L$ that are coprime to $P$ , that is:
$$T(P,L) = \sum_{k=1\atop {gcd(k,P)=1}}^L1$$
Solving this, I assume, will be a significant step in solving the original question of $Q(L)$ in my approach.
Also, if you have another approach in your mind to solving this problem, other than the $GCD$ approach, it'll be excellent as well.
Thanks in advance.