I have asked this question exactly [here](https://math.stackexchange.com/questions/2450607/on-siegel-mass-formula). The question is as follows: 


I am interested deeply in the following problem:  

Let $f$ be a (fixed) positive definite quadratic form; and let $n$ be an arbitrary natural number; then find a closed formula for the number of solutions to the equation $f=n$. 


* For special case $P\_{-4}(x,y)=x^2+y^2$, [here](https://mathoverflow.net/questions/242820/jacobis-theorem-on-sums-of-two-squares-reference-request) gives a closed formula for number of solutions.  

Also, you can find another formula for the special cases $P\_{-20}(x,y)=x^2+5y^2$ and $P\_{-28}(x,y)=x^2+7y^2$ there.
* You can finde a close formula here for $P\_{-8}(x,y)=x^2+2y^2$, [here](https://oeis.org/A033715).
* You can finde a close formula here for $P\_{-3}(x,y)=x^2+xy+y^2$, [here](https://mathoverflow.net/questions/78361/which-integers-take-the-form-x2-xy-y2). 
Also, you can find the answer for (only finitely many) other forms there, 
maybe [this](https://mathoverflow.net/questions/86456/how-many-solutions-are-there-to-sum-i-13-x-i2x-iy-iy-i2-k) helps too.
* You can finde a close formula here for $f(x,y,z,w)=x^2+y^2+z^2+w^2$, [here](https://mathoverflow.net/questions/84897/proofs-of-jacobis-four-square-theorem).
* By a more Intelligently search through the web; you can find similar formulas for the only finite limited number of positive definite quadratic forms.  

[I think there exists such an explicit formula at most for $10000$ quadratic forms. **Am I right?**]




---




---


As I have mentioned (I am not sure of it!) only for a finite number of quadratic forms we have such an explicit, closed, nice formula; and this way goes in the dead-end for arbitrary quadratic forms. 


So *Dirichlet* tries to find the (weighted) sum of such representations by binary quadratic forms of the same discriminant. 


That formula works very nice for our purpose if the genera contain exactly one form. In the Dirichlet formula, each binary quadratic forms appears by weight one in the (weighted) sum.  

More precisely let $f\_1, f\_2, ..., f\_h=f\_{h(D)}$ be a complete set of representatives for reduced binary quadratic forms of discriminant $D < 0$; 
then for every $n \in \mathbb{N}$, with $\gcd(n,D)=1$ we have: 


$$ 
\sum\_{i=1}^{h(D)} 
N(f\_i,n) 
= 
\omega (D) 
\sum\_{d \mid n} 
\left( \dfrac{D}{d}\right) 
; 
$$


where $\omega (-3) =6$ and $\omega (-4) =4$ 
and for every other (possible) value of $D<0$ we have $\omega (D) =2$. 
Also by $N(f,n)$; 
we meant number of integral representations of $n$ by $f$; i.e. : 


$$ 
N(f,n) 
:= 
N\big(f(x,y),n\big) 
= 
\# 
\{(x,y) \in \mathbb{Z}^2 : f(x,y)=n \} 
. 
$$




---




---


I have heard that there is a generalization of Dirichlet's theorem; for quadratic forms **in more variables**, due to Siegel. 
I have searched through the web; 
but I have found only this link : [Smith–Minkowski–Siegel mass formula](https://en.wikipedia.org/wiki/Smith%E2%80%93Minkowski%E2%80%93Siegel_mass_formula) ; 
also, I confess that I can't understand the whole of this wiki-article. 



> 
> Could anyone introduce me a simple reference in English; for Siegel mass formula?
> 
> 
> 




---




---


Also you can find better informations [here](https://math.stackexchange.com/questions/645171/counting-the-number-of-integral-solutions-to-x2dy2-n/893220#893220), and may be [here](https://math.stackexchange.com/questions/2363582/quadratic-forms-of-discriminant-47-explicit-bases-for-s-1-gamma-047-va) & [here](https://mathoverflow.net/questions/8326/is-there-an-approach-to-understanding-solution-counts-to-quadratic-forms-that-do).



On Siegel mass formula
There are *many, many* references on quadratic forms. This is a huge area, depending on which way you want to go. One of the main approaches is to construct a theta series associated to your quadratic form whose Fourier coefficients give you the representation numbers you want. These are modular forms, and this is treated in many introductions to modular forms (in fact, I have some notes on this).


One specific reference which I think is nice is the book:



> 
> *Topics in Classical Automorphic Forms*, by Henryk Iwaniec.
> 
> 
> 


He discusses the Siegel mass formula in a simple setting and explains how you can use can get formulas for representation numbers in special cases. In general, you can get "explicit formulas" for representation numbers in terms of Fourier coefficients of Hecke eigenforms. You can get nice asymptotics on representation numbers this way, though the precise arithmetic of Fourier coefficients of cuspidal eigenforms is mysterious.


