Generalizing the growth of sums of two squares

259 Views Asked by At

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$.