Given a positive integer $n$, the number of non-negative integer solutions to the equation $x^2+y^2=n$ depends only on the prime factorization of $n$. In particular, only divisors which are congruent to $1\pmod 4$ will increase the number of solutions. This is because these are the primes splitting in $\mathbb{Q}(i)/\mathbb{Q}$ and the norm map sends $x+iy$ to $x^2+y^2$. So we can read all of this information off of the coefficients of the corresponding Dedekind zeta function.
Gauss's circle problem instead asks for the number of lattice points inside a circle of radius $n$ centered at the origin, so this is just summing the first $n$ coefficients of the zeta function (and multiplying by 4 to allow negative numbers. Probably I should be more careful about 0, but we're at least very close). Of course we have a decent approximation for the answer to this problem, there should be about $\pi n^2$ lattice points in the circle.
Side question 1) This implies that the average coefficient of the zeta function for $\mathbb{Q}(i)$ is $\pi/4$. Do we expect the average coefficient of general zeta functions/L functions to have some nice interpretation?
Side question 2) It seems like it should be somewhat annoying but not too hard to combine these two paragraphs to show that there are infinitely many primes $1\pmod 4$ and even to get a decent approximation of the number of such primes less than a given $N$. I know the usual proof of Dirichlet's theorem and realize this isn't so different, but it seems like the lattice counting point of view should give a different approach.
Main question) How much does the above generalize? Ie, for which polynomials $f(x_1,...,x_k)$ does counting lattice points inside $f(x_1,...,x_k)=n$ as $n$ varies give information about the densities of certain primes? Conversely, which sets of prime numbers are counted by some polynomial, and does this lead to more regular behavior of these primes than we might expect?
I have a few guesses about this but nothing very solid. I'd guess that polynomials arising from norm maps of number fields would tell you about the splitting of primes in that number field, so abelian extensions of $\mathbb{Q}$ would tell you about primes in specific arithmetic progressions (or sums of arithmetic progressions). I've read the book Primes of the Form $x^2+ny^2$, so I have some idea that if the class number is greater than 1 things will get hairy, but I still hope there are some results for such fields - maybe looking at multiple polynomials at once to cover different genera?