Find the number of rational numbers $r$, $0<r<1,$ such that when $r$ is written as a fraction in lowest terms, the numerator and the denominator have a sum of $1000$.
We need $r=\frac a{1000-a}$ with $a<1000-a$ and $\gcd(a,1000-a)=1$. Since $\gcd(a,1000-a)=\gcd(a,1000)$, this means $a<500$ and $\gcd(a,1000)=1$.
The numbers below $1000$ coprime to $1000$ are $\varphi(1000)=1000\cdot\frac12\cdot\frac45=400$, and they pair up as $a,1000-a$, one in each pair below $500$.
So there are $200$ such $r$. The answer is $\boxed{200}$.
Find the number of rational numbers $r$, $0<r<1,$ such that when $r$ is written as a fraction in lowest terms, the numerator and the denominator have a sum of $2025$.