# Generalizing the growth of sums of two squares

Consider the set $S$ of numbers which are the sum of two (integer) squares, and define $S(n)$ as the number of members of $S$ in $\{1,2,\ldots,n\}.$ It is well-known that $$S(n) \sim \frac{Kn}{\sqrt{\log n}}$$ with a constant $K$ (0.7642..., called the Landau-Ramanujan constant).

Sums of two squares can be characterized as numbers of the form $ab^2$ where $a$ is a product of distinct primes $\equiv\{1,2\}\pmod4.$ I expect that any modulus $m$ and any subset $T\subseteq\{0,1,\ldots,m-1\}$ containing $0<t<\varphi(m)$ elements coprime to $m$ would have similar growth: $$T(n) \sim \frac{Cn}{\sqrt{\log n}}$$ for some constant $C>0$ depending on $m$ and $T$. Is this true? Perhaps the denominator needs to be $(\log n)^d$ for some $d$ depending on $m$ and $T$ as well?

Edit: I would settle for the (simpler?) case where $b=1$.

• You get the same outcome for numbers represented by at least one quadratic form of a fixed discriminant. Also primitively represented. I don't see this working for, say, norm forms for cubic fields math.stackexchange.com/questions/329936/… – Will Jagy Jun 16 '16 at 18:31
• Alright, I started to become uncertain after i typed the answer, so i left it for your comment. – Will Jagy Jun 16 '16 at 18:54
• I don't quite follow the statement: if the set $T$ depends on $n$, how can you have an asymptotic in $n$ that depends on $T$? Similarly what is $m$ in the definition of $T$? – Erick Wong Jun 21 '16 at 20:15
• if you're just asking about the distribution of sums of squares in a fixed residue class, I believe that was studied by Hooley. – Erick Wong Jun 21 '16 at 20:17
• @Charles Ahhh now I get it. Yes, I think in many cases such an asymptotic is achievable via Selberg-Delange or Wirsing-Odoni. As you guessed, the exponent will be something like $1-t/\phi(m)$ instead of $1/2$. – Erick Wong Jun 22 '16 at 1:03