# Which quaternary quadratic form represents $n$ the greatest number of times?

Let $Q$ be a four-variable positive-definite quadratic form with integer coefficients and let $r_{Q}(n)$ be the number of representations of $n$ by $Q$. The theory of modular forms explains how $r_{Q}(n) = a_{E}(n) + a_{C}(n)$ is broken into the Eisenstein series piece, and the cusp form piece. Knowing what numbers are represented by $Q$ boils down to getting a formula for $a_{E}(n)$ which is of size ''about'' $n$ (as long as local conditions are satified - the formula of Siegel makes this precise), and bounding $|a_{C}(n)|$ (which is $\leq C_{Q} d(n) \sqrt{n}$, where $d(n)$ is the number of divisors of $n$). The hardest part of this is determining $C_{Q}$, and all the methods for doing this rely on bounds for $r_{Q}(n)$.

My question is

If $n$ is a fixed positive integer, what is ${\rm max}_{Q}~r_{Q}(n)$? Here the max runs over all 4-variable positive-definite integral quadratic forms.

My suspicion is that this max always occurs for a form $Q$ with low discriminant, and in particular I would guess the max is always $\leq 24 \sigma(n)$. Equality is achieved for odd $n$ with $Q = x^{2} + y^{2} + z^{2} + w^{2} + xw + yw + zw$, the smallest discriminant quaternary form. (Edit: There are some $n$ that are represented more ways with a form of discrimiant $5$. It seems the right conjecture is $r_{Q}(n) \leq 30 \sigma(n)$.)

I would even be satisfied with a bound of the type $r_{Q}(n) \leq C n \log(n)$ with a value of $C$ that doesn't depend on $Q$. It's possible that one could prove something like this for quadratic polynomials by induction on the number of variables, but I don't see how to make that work. (It seems that $2$ variables is the naturally starting point.)

Another possible approach is something like the circle method, which can recover similar bounds to those which the theory of modular forms gives. In the papers on this subject though, the dependence on the form in the error term seems to make a result of the type I seek difficult.

• One possibility for a partial result: restrict to $Q$ being a norm form from a quaternion algebra, and use bounds for the number of elements of norm $n$ in a maximal order. (See Conway-Smith for the case of Hamilton's quaternions over $\mathbb Q$.) Dec 7, 2016 at 14:04
• forms with a square factor in the discriminant that are represented by a form of lower discriminant cannot be the best. Similar if a form is anisotropic at some prime, although you may then consider $n$ not divisible by that prime. Easy enough to do a competition for the first few forms in Nipp's tables, and target numbers up to a modest bound. Need to see whether I ever wrote a function to count representations for quaternaries. Dec 7, 2016 at 16:45
• I added Valentin Blomer's remarks under my post, which show that in fact we have $r_Q(n)\ll\sigma(n)$ with an absolute implied constant. Dec 8, 2016 at 21:33

Theorem. Let $$Q(x_1,\dots,x_k)$$ be a positive definite integral quadratic form in $$k\geq 2$$ variables. Then the number of integral representations $$Q(x_1,\dots,x_k)=n$$ satisfies $$r_Q(n)\ll_{k,\epsilon}n^{k/2-1+\epsilon}.$$ The implied constant depends only on $$k$$ and $$\epsilon$$, so it is independent of the actual coefficients of $$Q$$.

Remark. The "Added 1" section, posted with the permission of Valentin Blomer, contains a more precise result for $$k=4$$.

Proof. We induct on $$k$$, and for simplicity we do not indicate the dependence of implied constants on $$k$$. The case $$k=2$$ is classical and goes back to Gauss (see the "Added 2" section for more details). So let $$k\geq 3$$, and assume that the statement holds with $$k-1$$ in place of $$k$$. We can assume that $$Q(x_1,\dots,x_k)=\sum_{1\leq i,j\leq k} a_{ij}x_ix_j$$ is Minkowski reduced. In particular, $$a_{ij}=a_{ji}$$ and $$0 Then we have a decomposition $$Q(x_1,\dots,x_k)=\sum_{i=1}^k h_i\left(\sum_{i\leq j\leq k}c_{ij}x_j\right)^2,$$ where $$h_i\asymp a_{ii}$$, $$c_{ii}=1$$ and $$c_{ij}\ll 1$$ (see Theorem 3.1 and Lemma 1.3 in Chapter 12 of Cassels: Rational quadratic forms). In particular, the coefficients of $$Q$$ satisfy $$a_{11}\dots a_{kk}\asymp h_1\dots h_k=\det(Q),$$ hence also $$a_{ij}\ll a_{kk}\ll\det(Q)$$ and $$h_k\asymp a_{kk}\gg\det(Q)^{1/k}$$.

We fix the positive integer $$n$$, and we consider the integral representations $$Q(x_1,\dots,x_k)=n$$. The number of representations with $$x_k=0$$ is $$\ll_{\epsilon}n^{k/2-3/2+\epsilon}$$ by the induction hypothesis, so we can focus on the representations with $$x_k\neq 0$$. From the above, we see immediately that $$x_k\ll\sqrt{n}\det(Q)^{-1/(2k)}$$, and then also that $$x_{k-1}\ll\sqrt{n}$$, then $$x_{k-2}\ll\sqrt{n}$$, and so on, finally $$x_3\ll\sqrt{n}$$. It follows that there are $$\ll n^{(k-2)/2}\det(Q)^{-1/(2k)}$$ choices for the $$(k-2)$$-tuple $$(x_3,\dots,x_k)$$ such that $$x_k\neq 0$$. Fixing such a tuple, we are left with an inhomogeneous binary representation problem $$a_{11}x_1^2 + 2a_{12}x_1x_2 + a_{22}x_2^2 + d_1 x_1 + d_2 x_2 + e = 0$$ with fixed integral coefficients $$d_1,d_2\ll\sqrt{n}\det(Q)$$ and $$e\ll n\det(Q)$$. Using Lemma 8 in this paper of Blomer and Pohl, it follows that the number of choices for $$(x_1,x_2)$$ is $$\ll_\epsilon n^\epsilon\det(Q)^\epsilon$$. Summing up, we get $$r_Q(n)\ll_{\epsilon} n^{k/2-3/2+\epsilon} + n^{(k-2)/2+\epsilon}\det(Q)^{-1/(2k)+\epsilon} \ll n^{k/2-1+\epsilon},$$ and we are done.

Added 1. I have been in touch with Valentin Blomer about the original question, and my answer above incorporated a key input from him. More importantly, he realized that the above argument together with some automorphic input allows one to prove, for the case of $$k=4$$ variables, the striking uniform upper bound (with an absolute implied constant) $$r_Q(n) \ll \sigma(n).$$ Here is the argument of Valentin Blomer, posted with his permission. For $$n\leq\det(Q)^{10}$$, the last line of the inductive proof above gives $$r_Q(n)\ll_{\epsilon} n^{1/2+\epsilon} + n^{1+\epsilon}\det(Q)^{-1/8+\epsilon} \ll n^{79/80+2\epsilon},$$ so we can (and we shall) assume that $$n>\det(Q)^{10}$$. We decompose the $$\theta$$-series of $$Q$$ uniquely as $$\theta_Q(z) = E(z) +S(z) = \sum_{n=1}^\infty a(n) e(nz) + \sum_{n=1}^\infty b(n) e(nz)$$ into an Eisenstein series and a cusp form of weight $$2$$ and level $$N$$, which is the level of $$Q$$. Accordingly, $$r_Q(n)=a(n)+b(n)$$, so it suffices to show that $$a(n)\ll\sigma(n)$$ and $$b(n)\ll\sigma(n)$$. The first bound was proved by Gogishvili (Georgian Math. J. 13 (2006), 687-691.), as follows from (2) and (13)-(14) in his paper. Therefore, it suffices to prove the second bound. We write $$S = \sum_{f \in B} c(f) f$$ in terms of an orthonormal Hecke eigenbasis $$B$$ for $$S_2(N, \chi)$$, where $$\chi$$ is a quadratic character and the inner product is given by $$(f, g) = \int_{\Gamma_0(N)\backslash \mathcal{H}} f(z)\bar{g}(z) \frac {dx\, dy}{y^2}.$$ We write $$f(z) = \sum_n \lambda_f(n) e(nz)$$, so that $$b(n) = \sum_f c(f) \lambda_f(n)$$. We avoid any use of Eichler/Deligne, among other things because it would require us to deal with oldforms carefully. Instead, we use the Petersson formula and Weil's bound for Kloosterman sums (together with Cauchy-Schwarz and Parseval): $$\begin{split} |b(n) |^2 \| S \|_2^{-2} n^{-1} & \leq n^{-1} \sum_f |\lambda_f(n)|^2 \ll 1 + \sum_{c} \frac{1}{c} S_{\chi}(n, n, c) J_1\left(\frac{4\pi n}{c}\right)\\ & \ll 1 + \sum_{c} \frac{(n, c)^{1/2}\tau(c)}{c^{1/2}} \min\left(\frac{n}{c}, \frac{c^{1/2}}{n^{1/2}}\right) \ll_\epsilon n^{1/2 + \epsilon}, \end{split}$$ so that $$b(n) \ll_\epsilon \| S \|_2 n^{3/4 + \epsilon}.$$ We have, by Lemma 4.2 of Blomer (Acta Arith. 114 (2004), 1-21.), $$\| S \|_2 \ll_\epsilon \det(Q)^{2+\epsilon},$$ whence in the end $$b(n) \ll_\epsilon \det(Q)^{2+\epsilon} n^{3/4 + \epsilon} \leq n^{19/20+2\epsilon}.$$ This concludes the proof. We note that for the twisted Kloosterman sum, the Weil-Estermann bound is not always true for higher prime powers, see Section 9 of Knightly-Li (Mem. Amer. Math. Soc. 224 (2013), no. 1055), but it is true for the case of quadratic characters that we are using here.

Added 2. Let me provide the details for the case $$k=2$$. Without loss of generality, $$Q(x,y)=ax^2+bxy+cy^2$$ is a reduced form. That is, $$|b|\leq a\leq c,\qquad\text{whence also}\qquad a\ll\det(Q)^{1/2}.$$ The equation $$Q(x,y)=n$$ can be rewritten as $$(2ax+by)^2+4\det(Q)y^2=4an.$$ We can assume that there are (integral) solutions with nonzero $$y$$, for otherwise there are at most two solutions. In this case, $$n\geq\det(Q)/a\gg a.$$ The equation factors in the ring of integers of an imaginary quadratic number field, hence a standard divisor bound argument combined with the previous display yields that the number of solutions is $$\ll_\epsilon(an)^\epsilon\ll_\epsilon n^{2\epsilon}.$$

• @JeremyRouse: I revised my response substantially, the bound is now independent of $Q$. Dec 8, 2016 at 13:14
• This is fabulous! Dec 8, 2016 at 14:36
• Wow. This is really cool. Dec 12, 2016 at 12:26

GH from MO gave in his answer a bound due to himself and Valentin Blomer of $O(\sigma(n))$. I thought it would be interesting to compute the $O$. Here I'm looking for an effective bound of the form $\leq C \Delta^{-\delta} \sigma(n) + o(\sigma(n))$ where the $C$ is explicit but the little $o$ need not be, so we only need be concerned with the Eisenstein term.

The formula in the cited paper is $$\frac{\pi^2 n}{\sqrt{\Delta/16}} \prod_p \chi(p)$$

Define $f_Q(p)$ to be the max over $n$ of $\frac{\chi(p)}{p^{v_p(\Delta)/2}} (\sum_{t=0}^{v_p(n)} p^{-t})$

Then the main term

$$\frac{4\pi^2 n}{\sqrt{\Delta}} \prod_p \chi(p) \leq 4\pi^2 \sigma(n) \prod_p f_Q(p)$$

So our goal is to upper bound $f_Q(p)$. According to the paper, for primes not dividing the discriminant $\Delta$, $\chi(p)= \left(1- \left(\frac{\Delta}{p} \right)p^{-2}\right) \sum_{t=0}^{v_p(n)}\left(\frac{\Delta}{p} \right)^t p^t$ so $f_Q(p) = 1- \left(\frac{\Delta}{p} \right)p^{-2}$. So the primes not dividing the discriminant contribute $\prod_p\left(1- \left(\frac{\Delta}{p} p^{-2} \right) \right)= L(\chi_{\sqrt{\Delta}},2)^{-1}$. However for a crude upper bound, we instead use $\chi(p) \leq 1+1/p^2$.

For odd primes dividing the discriminant, the bounds given for $\chi(p)$ depend on whether $p$ divides $n$ or not. If $p$ does not divide $n$, they depend further on $n_1$, which is the rank of the quadratic form mod $p$. In this case $\chi(p) \leq 2$ if the rank is $1$ but is at most $1+1/p$ otherwise. The rank can only be $1$ if $v_p(d) \geq 3$, because each term in the formula for the determinant $d$ of the symmetric matrix will be divisible by $p^3$. If $p$ does not divide $n$, the bound for $f_Q(p)$ is $p^{v_p(d)/6} (1+p^{-2}) (1+p^{-1})$. So we have

$$f_Q(p) \leq \max \left( \frac{1 + 1/p}{p^{v_p(d)/2}}, \frac{1 + 1_{v_p(d) \geq 3}}{p^{v_p(d)/2}}, \frac{ 1 + p^{-2}}{p^{v_p(d)/3}}\right)$$

The third contribution is always the greatest as long as $(1+1/p) \leq p^{1/6} (1+ 1/p^2)$, which happens for all $p>2$, and $2 \leq \sqrt{p} (1+1/p^2)$, which happens for $p>3$ and only fails by a factor of $.962$ for $p=3$.

The remaining contribution is the local contribution at the prime $2$. The paper gives the bound $4 \cdot 2^{ (v_2(\Delta)-4)/6}$ for $\chi(2)$ and hence $f_Q(2) \leq 2^{4/3} 2^{-v_2(\Delta)/3}$.

Hence $$\prod_p f_Q(p) \leq \frac{2^{4/3}}{(1+1/4)}\frac{2}{\sqrt{3} (1+ 1/9)}\frac{1}{\Delta^{1/3}} \prod_p (1+1/p^2)$$

Using

$$\prod_p (1+ p^{-2}) = \frac{\zeta(2)}{\zeta(4)}=\frac{15}{\pi^2}$$ we get an upper bound for the main term of

$$\frac{2^{4/3}}{(1+1/4)}\frac{2}{\sqrt{3} (1+ 1/9)}\frac{60 \sigma(n)}{\Delta^{1/3}}= 125.697\dots \frac{\sigma(n)}{\Delta^{1/3}}$$

To get the ratio under $30$, then, we need $\Delta>73$.

Combined with Valentin and GH's arguments, I believe this implies that there are only finitely many counterexamples to "the number of representatives is at most $30 \sigma(n)$" with $\Delta>73$.

It might be possible to prove a sharp bound by:

1) bounding the error term explicitly to eliminate large $\Delta$ counterexamples.

2) Explicitly calculating the main term for medium $\Delta$, instead of using this crude bound, to eliminate medium $\Delta$ counterexamples.

3) Explicitly calculating the main term and showing the error term vanishes for small $\Delta$, explicitly calculating the highest examples.

• @GHfromMO Thank you, I was not sure. That is lovely. I think Jeremy is grading finals, I did send him an email about your addition to your answer and Will's answer. I suggested that, with a discriminant bound, finding an explicit constant really depends on whether we need to deal with 5 forms, among which the optimum is guaranteed, or 5000 forms. Dec 9, 2016 at 22:45
• @WillJagy I mean my calculations do give an explict constant for the main term, just not an explicit second-order term. For me the second-order term is of lesser interest even if one does not have explicit bounds on it - this is just because, as long as there is at least one explicit bound, how strong the explicit bound is makes no difference for the constant. But to make the upper bound fully explicit one would have to make the $n^{79/80+2\epsilon}$ and $n^{19/20+2\epsilon}$ in GH and Valentin's argument explicit, which might be subtle. Dec 10, 2016 at 13:13
• @WillSawin: I think that it would not be too hard, but somewhat tedious, to get an upper bound of the form $r_Q(n)\leq C\sigma(n)\det(Q)^{-\delta}$, where $C>0$ and $\delta>0$ are explicit. constants. Dec 10, 2016 at 20:55
• @GHfromMO this is a bit disappointing, I think it is relevant. There are forms of arbitrarily large discriminant that represent the fixed number $1$ exactly twelve times. This makes me think that your $C, \delta$ cannot work for every $n.$ Hope that makes sense. Dec 11, 2016 at 3:59
• Yes, that example causes a problem as far as the simplest type of discriminant bounds; take a positive ternary $f(x,y,z)$ that represents some $N$ exactly $k$ times. Then, for $T \geq N+1,$ $f(x,y,z) + T w^2$ still represents $N$ exactly $k$ times. But $\sigma(N)$ is fixed, while $\det Q$ is increasing without bound. I think this says that $r_Q(n) \leq C \sigma(n) \det(Q)^{- \delta}$ is overoptimistic. Dec 11, 2016 at 4:11

In a comment under Will Sawin's answer, GH says that it should not be too difficult to find a (relatively small) constant $C$ and a proof for $$r_Q(n) \leq \, C \; \sigma(n) \, \det(Q)^{-1/9} \; + \; n^{4/5}$$ which, if $C$ were found to be small enough, would give teeth to the computations below.

I did want to see the behavior of specific forms of low discriminant from Nipp's tables, as Jeremy briefly indicated in an email. To get $r(n) \geq 15 \sigma(n)$ we seem to need discriminant $d \leq 21.$ To get $r(n) \geq 20 \sigma(n)$ we seem to need discriminant $d = 4,5.$

I should add that there are infinitely many forms that give $r(1) = 12,$ so that this ratio is at least $12.$ Given any positive integer $T \geq 2,$ $$( x^2 + y^2 + z^2 + yz + zx + xy) + T w^2$$ represents $1$ twelve times.

Discriminant $4$ achieves the ratio $24.$ For $d=5,$ with prime $p \equiv \pm 2 \pmod 5,$ we get $$r(p) = 30 (p-1) = 30 \; \sigma(p) \cdot \left( \frac{p-1}{p+1} \right)$$

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

d = 5
n      reps     sigma
ratio  20                                1       20        1  1 =  1
ratio  10                                2       30        3  2 = 2
ratio  15                                3       60        4  3 = 3
ratio  20                                5      120        6  5 = 5
ratio  22.5                              7      180        8  7 = 7
ratio  25.7142857142857                 13      360       14  13 = 13
ratio  26.6666666666667                 17      480       18  17 = 17
ratio  27.5                             23      660       24  23 = 23
ratio  28.4210526315789                 37     1080       38  37 = 37
ratio  28.6363636363636                 43     1260       44  43 = 43
ratio  28.75                            47     1380       48  47 = 47
ratio  28.8888888888889                 53     1560       54  53 = 53
ratio  29.1176470588235                 67     1980       68  67 = 67
ratio  29.1891891891892                 73     2160       74  73 = 73
ratio  29.2857142857143                 83     2460       84  83 = 83
ratio  29.3877551020408                 97     2880       98  97 = 97
ratio  29.4230769230769                103     3060      104  103 = 103
ratio  29.4444444444444                107     3180      108  107 = 107
ratio  29.4736842105263                113     3360      114  113 = 113
ratio  29.53125                        127     3780      128  127 = 127


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  d  4 record ratio  24 number  1       sigma  1   reps  24
d  5 record ratio  29.6969696969697 number  197       sigma  198   reps  5880
d  8 record ratio  17.8181818181818 number  197       sigma  198   reps  3528
d  9 record ratio  12 number  1       sigma  1   reps  12
d  12 record ratio  19.4117647058824 number  67       sigma  68   reps  1320
d  12 record ratio  19.7979797979798 number  197       sigma  198   reps  3920
d  13 record ratio  13.8585858585859 number  197       sigma  198   reps  2744
d  16 record ratio  8 number  1       sigma  1   reps  8
d  16 record ratio  12 number  1       sigma  1   reps  12
d  17 record ratio  8.91 number  199       sigma  200   reps  1782
d  20 record ratio  17.8181818181818 number  197       sigma  198   reps  3528
d  20 record ratio  13.7142857142857 number  194       sigma  294   reps  4032
d  20 record ratio  11.8787878787879 number  197       sigma  198   reps  2352
d  21 record ratio  15.8383838383838 number  197       sigma  198   reps  3136
d  21 record ratio  15.84 number  199       sigma  200   reps  3168
d  24 record ratio  11.88 number  199       sigma  200   reps  2376
d  24 record ratio  12 number  1       sigma  1   reps  12
d  24 record ratio  11.8666666666667 number  179       sigma  180   reps  2136
d  25 record ratio  6 number  1       sigma  1   reps  6
d  28 record ratio  9.89010989010989 number  181       sigma  182   reps  1800
d  28 record ratio  12 number  1       sigma  1   reps  12
d  28 record ratio  9.89583333333333 number  191       sigma  192   reps  1900
d  29 record ratio  10 number  5       sigma  6   reps  60
d  29 record ratio  12 number  1       sigma  1   reps  12
d  32 record ratio  9.8989898989899 number  197       sigma  198   reps  1960
d  32 record ratio  11.8787878787879 number  197       sigma  198   reps  2352
d  32 record ratio  12 number  1       sigma  1   reps  12
d  32 record ratio  8.46031746031746 number  166       sigma  252   reps  2132
d  32 record ratio  11.8666666666667 number  179       sigma  180   reps  2136
d  33 record ratio  8 number  1       sigma  1   reps  8
d  33 record ratio  7.91752577319588 number  193       sigma  194   reps  1536
d  33 record ratio  7.91666666666667 number  191       sigma  192   reps  1520
d  36 record ratio  12 number  1       sigma  1   reps  12
d  36 record ratio  12 number  5       sigma  6   reps  72
d  36 record ratio  8 number  1       sigma  1   reps  8
d  36 record ratio  11.9504132231405 number  81       sigma  121   reps  1446
d  36 record ratio  7.9843137254902 number  128       sigma  255   reps  2036
d  37 record ratio  12 number  1       sigma  1   reps  12
d  37 record ratio  7.54166666666667 number  191       sigma  192   reps  1448
d  40 record ratio  12 number  1       sigma  1   reps  12
d  40 record ratio  7.75257731958763 number  193       sigma  194   reps  1504
d  40 record ratio  7.92156862745098 number  101       sigma  102   reps  808
d  40 record ratio  7.84 number  149       sigma  150   reps  1176
d  41 record ratio  8 number  1       sigma  1   reps  8
d  41 record ratio  5.33333333333333 number  2       sigma  3   reps  16
d  44 record ratio  8.64 number  149       sigma  150   reps  1296
d  44 record ratio  8.55172413793103 number  173       sigma  174   reps  1488
d  44 record ratio  12 number  1       sigma  1   reps  12
d  44 record ratio  8.53658536585366 number  163       sigma  164   reps  1400
d  45 record ratio  11.8787878787879 number  197       sigma  198   reps  2352
d  45 record ratio  12 number  1       sigma  1   reps  12
d  45 record ratio  11.8762886597938 number  193       sigma  194   reps  2304
d  45 record ratio  11.5555555555556 number  159       sigma  216   reps  2496
d  45 record ratio  11.8787878787879 number  197       sigma  198   reps  2352
d  48 record ratio  11.8787878787879 number  197       sigma  198   reps  2352
d  48 record ratio  9.8989898989899 number  197       sigma  198   reps  1960
d  48 record ratio  9.8989898989899 number  197       sigma  198   reps  1960
d  48 record ratio  12 number  1       sigma  1   reps  12
d  48 record ratio  9.9 number  199       sigma  200   reps  1980
d  48 record ratio  9.12592592592593 number  178       sigma  270   reps  2464
d  48 record ratio  11.88 number  199       sigma  200   reps  2376
d  48 record ratio  12 number  11       sigma  12   reps  144
d  48 record ratio  9.1 number  158       sigma  240   reps  2184
d  49 record ratio  4 number  1       sigma  1   reps  4
d  52 record ratio  6.53061224489796 number  194       sigma  294   reps  1920
d  52 record ratio  6.40740740740741 number  142       sigma  216   reps  1384
d  52 record ratio  12 number  1       sigma  1   reps  12
d  52 record ratio  8.36842105263158 number  151       sigma  152   reps  1272
d  52 record ratio  5.57894736842105 number  151       sigma  152   reps  848
d  52 record ratio  6 number  1       sigma  1   reps  6
d  53 record ratio  8.12903225806452 number  61       sigma  62   reps  504
d  53 record ratio  12 number  1       sigma  1   reps  12
d  53 record ratio  8 number  11       sigma  12   reps  96
d  56 record ratio  8 number  1       sigma  1   reps  8
d  56 record ratio  7.31578947368421 number  151       sigma  152   reps  1112
d  56 record ratio  7.46666666666667 number  89       sigma  90   reps  672
d  56 record ratio  12 number  1       sigma  1   reps  12
d  56 record ratio  7.15151515151515 number  131       sigma  132   reps  944
d  57 record ratio  8 number  1       sigma  1   reps  8
d  57 record ratio  5.67708333333333 number  191       sigma  192   reps  1090
d  57 record ratio  5.69072164948454 number  193       sigma  194   reps  1104
d  57 record ratio  6 number  1       sigma  1   reps  6
d  60 record ratio  9.89690721649485 number  193       sigma  194   reps  1920
d  60 record ratio  12 number  1       sigma  1   reps  12
d  60 record ratio  9.89690721649485 number  193       sigma  194   reps  1920
d  60 record ratio  9.86666666666667 number  149       sigma  150   reps  1480
d  60 record ratio  9.86666666666667 number  149       sigma  150   reps  1480
d  60 record ratio  9.9 number  199       sigma  200   reps  1980
d  60 record ratio  9.9 number  199       sigma  200   reps  1980
d  60 record ratio  9.88095238095238 number  167       sigma  168   reps  1660
d  61 record ratio  12 number  1       sigma  1   reps  12
d  61 record ratio  6 number  5       sigma  6   reps  36
d  61 record ratio  6 number  1       sigma  1   reps  6
d  64 record ratio  6 number  1       sigma  1   reps  6
d  64 record ratio  12 number  1       sigma  1   reps  12
d  64 record ratio  6.66666666666667 number  5       sigma  6   reps  40
d  64 record ratio  4 number  1       sigma  1   reps  4
d  64 record ratio  6 number  1       sigma  1   reps  6
d  64 record ratio  6 number  1       sigma  1   reps  6
d  64 record ratio  6 number  3       sigma  4   reps  24
d  65 record ratio  8 number  1       sigma  1   reps  8
d  65 record ratio  5.24137931034483 number  173       sigma  174   reps  912
d  65 record ratio  5.28 number  149       sigma  150   reps  792
d  65 record ratio  6 number  1       sigma  1   reps  6
d  68 record ratio  9.6 number  19       sigma  20   reps  192
d  68 record ratio  12 number  1       sigma  1   reps  12
d  68 record ratio  8 number  1       sigma  1   reps  8
d  68 record ratio  6.09523809523809 number  41       sigma  42   reps  256
d  68 record ratio  6.12371134020619 number  193       sigma  194   reps  1188
d  68 record ratio  5.33888888888889 number  184       sigma  360   reps  1922
d  68 record ratio  5.32549019607843 number  128       sigma  255   reps  1358
d  69 record ratio  8.57142857142857 number  13       sigma  14   reps  120
d  69 record ratio  12 number  1       sigma  1   reps  12
d  69 record ratio  7.92 number  199       sigma  200   reps  1584
d  69 record ratio  7.92 number  199       sigma  200   reps  1584
d  69 record ratio  7.91919191919192 number  197       sigma  198   reps  1568
d  72 record ratio  8 number  1       sigma  1   reps  8
d  72 record ratio  7.33333333333333 number  83       sigma  84   reps  616
d  72 record ratio  12 number  1       sigma  1   reps  12
d  72 record ratio  7.16483516483517 number  181       sigma  182   reps  1304
d  72 record ratio  7.13924050632911 number  157       sigma  158   reps  1128
d  72 record ratio  7.33333333333333 number  83       sigma  84   reps  616
d  72 record ratio  7.15151515151515 number  131       sigma  132   reps  944
d  72 record ratio  7 number  159       sigma  216   reps  1512
d  72 record ratio  6.96774193548387 number  183       sigma  248   reps  1728
d  73 record ratio  4 number  1       sigma  1   reps  4
d  73 record ratio  6 number  1       sigma  1   reps  6
d  73 record ratio  4 number  2       sigma  3   reps  12
d  76 record ratio  12 number  1       sigma  1   reps  12
d  76 record ratio  5.42857142857143 number  139       sigma  140   reps  760
d  76 record ratio  5.24390243902439 number  163       sigma  164   reps  860
d  76 record ratio  6 number  1       sigma  1   reps  6
d  76 record ratio  5.31868131868132 number  181       sigma  182   reps  968
d  76 record ratio  6 number  1       sigma  1   reps  6
d  77 record ratio  12 number  1       sigma  1   reps  12
d  77 record ratio  8.10989010989011 number  181       sigma  182   reps  1476
d  77 record ratio  7.96153846153846 number  103       sigma  104   reps  828
d  77 record ratio  8.18181818181818 number  109       sigma  110   reps  900
d  77 record ratio  8.08 number  149       sigma  150   reps  1212
d  80 record ratio  12 number  1       sigma  1   reps  12
d  80 record ratio  9 number  167       sigma  168   reps  1512
d  80 record ratio  6 number  1       sigma  1   reps  6
d  80 record ratio  8 number  1       sigma  1   reps  8
d  80 record ratio  7.4639175257732 number  193       sigma  194   reps  1448
d  80 record ratio  8.90909090909091 number  197       sigma  198   reps  1764
d  80 record ratio  5.93939393939394 number  197       sigma  198   reps  1176
d  80 record ratio  7.58823529411765 number  67       sigma  68   reps  516
d  80 record ratio  7.42307692307692 number  103       sigma  104   reps  772
d  80 record ratio  5.87755102040816 number  194       sigma  294   reps  1728
d  80 record ratio  5.87755102040816 number  194       sigma  294   reps  1728
d  80 record ratio  7.39285714285714 number  188       sigma  336   reps  2484
d  81 record ratio  8 number  1       sigma  1   reps  8
d  81 record ratio  4.7 number  19       sigma  20   reps  94
d  81 record ratio  4 number  1       sigma  1   reps  4
d  81 record ratio  6 number  1       sigma  1   reps  6
d  81 record ratio  6 number  2       sigma  3   reps  18
d  84 record ratio  12 number  1       sigma  1   reps  12
d  84 record ratio  9.52747252747253 number  181       sigma  182   reps  1734
d  84 record ratio  7.35135135135135 number  146       sigma  222   reps  1632
d  84 record ratio  7.30612244897959 number  194       sigma  294   reps  2148
d  84 record ratio  8 number  1       sigma  1   reps  8
d  84 record ratio  6.4 number  179       sigma  180   reps  1152
d  84 record ratio  6.33333333333333 number  191       sigma  192   reps  1216
d  84 record ratio  6.35164835164835 number  181       sigma  182   reps  1156
d  84 record ratio  6.36 number  199       sigma  200   reps  1272
d  84 record ratio  7.25925925925926 number  142       sigma  216   reps  1568
d  84 record ratio  7.25925925925926 number  142       sigma  216   reps  1568
d  84 record ratio  9.56521739130435 number  137       sigma  138   reps  1320
d  84 record ratio  9.6 number  179       sigma  180   reps  1728
d  85 record ratio  12 number  1       sigma  1   reps  12
d  85 record ratio  6.26086956521739 number  137       sigma  138   reps  864
d  85 record ratio  6.03846153846154 number  103       sigma  104   reps  628
d  85 record ratio  6.10909090909091 number  109       sigma  110   reps  672
d  85 record ratio  6.4 number  29       sigma  30   reps  192
d  85 record ratio  6.10989010989011 number  181       sigma  182   reps  1112
d  88 record ratio  12 number  1       sigma  1   reps  12
d  88 record ratio  4.69230769230769 number  103       sigma  104   reps  488
d  88 record ratio  6 number  1       sigma  1   reps  6
d  88 record ratio  4.68 number  199       sigma  200   reps  936
d  88 record ratio  6 number  1       sigma  1   reps  6
d  88 record ratio  6 number  1       sigma  1   reps  6
d  88 record ratio  5 number  3       sigma  4   reps  20
d  89 record ratio  8 number  1       sigma  1   reps  8
d  89 record ratio  4.22222222222222 number  17       sigma  18   reps  76
d  89 record ratio  4 number  1       sigma  1   reps  4
d  89 record ratio  3.71428571428571 number  4       sigma  7   reps  26
d  92 record ratio  12 number  1       sigma  1   reps  12
d  92 record ratio  6 number  1       sigma  1   reps  6
d  92 record ratio  8 number  1       sigma  1   reps  8
d  92 record ratio  6.46666666666667 number  29       sigma  30   reps  194
d  92 record ratio  5.93406593406593 number  181       sigma  182   reps  1080
d  92 record ratio  6 number  1       sigma  1   reps  6
d  92 record ratio  5.93333333333333 number  179       sigma  180   reps  1068
d  93 record ratio  12 number  1       sigma  1   reps  12
d  93 record ratio  7.15714285714286 number  139       sigma  140   reps  1002
d  93 record ratio  7.125 number  31       sigma  32   reps  228
d  93 record ratio  8 number  1       sigma  1   reps  8
d  93 record ratio  7.5 number  23       sigma  24   reps  180
d  93 record ratio  7.02777777777778 number  71       sigma  72   reps  506
d  96 record ratio  12 number  1       sigma  1   reps  12
d  96 record ratio  8.45454545454546 number  43       sigma  44   reps  372
d  96 record ratio  6.88888888888889 number  107       sigma  108   reps  744
d  96 record ratio  6.72463768115942 number  137       sigma  138   reps  928
d  96 record ratio  8 number  1       sigma  1   reps  8
d  96 record ratio  7.91208791208791 number  181       sigma  182   reps  1440
d  96 record ratio  7.91208791208791 number  181       sigma  182   reps  1440
d  96 record ratio  6.6 number  199       sigma  200   reps  1320
d  96 record ratio  7.92 number  199       sigma  200   reps  1584
d  96 record ratio  7.92 number  199       sigma  200   reps  1584
d  96 record ratio  7.92 number  199       sigma  200   reps  1584
d  96 record ratio  5.73333333333333 number  118       sigma  180   reps  1032
d  96 record ratio  5.65079365079365 number  166       sigma  252   reps  1424
d  96 record ratio  5.63333333333333 number  158       sigma  240   reps  1352
d  96 record ratio  5.63333333333333 number  158       sigma  240   reps  1352
d  96 record ratio  7.88405797101449 number  137       sigma  138   reps  1088
d  96 record ratio  8 number  5       sigma  6   reps  48
d  96 record ratio  7.91111111111111 number  179       sigma  180   reps  1424
d  97 record ratio  4 number  1       sigma  1   reps  4
d  97 record ratio  6 number  1       sigma  1   reps  6
d  97 record ratio  3.5 number  3       sigma  4   reps  14
d  97 record ratio  3.33333333333333 number  2       sigma  3   reps  10
d  100 record ratio  12 number  1       sigma  1   reps  12
d  100 record ratio  6 number  3       sigma  4   reps  24
d  100 record ratio  6.28571428571429 number  13       sigma  14   reps  88
d  100 record ratio  6 number  1       sigma  1   reps  6
d  100 record ratio  7.97435897435897 number  125       sigma  156   reps  1244
d  100 record ratio  6 number  1       sigma  1   reps  6
d  100 record ratio  5 number  3       sigma  4   reps  20
d  100 record ratio  3.9921568627451 number  128       sigma  255   reps  1018
d  101 record ratio  12 number  1       sigma  1   reps  12
d  101 record ratio  8 number  1       sigma  1   reps  8
d  101 record ratio  6 number  19       sigma  20   reps  120
d  101 record ratio  6 number  5       sigma  6   reps  36
d  101 record ratio  6 number  1       sigma  1   reps  6
d  104 record ratio  12 number  1       sigma  1   reps  12
d  104 record ratio  5.06122448979592 number  97       sigma  98   reps  496
d  104 record ratio  5.15463917525773 number  193       sigma  194   reps  1000
d  104 record ratio  5.22448979591837 number  97       sigma  98   reps  512
d  104 record ratio  6 number  1       sigma  1   reps  6
d  104 record ratio  8 number  1       sigma  1   reps  8
d  104 record ratio  5.33333333333333 number  5       sigma  6   reps  32
d  104 record ratio  5.11392405063291 number  157       sigma  158   reps  808
d  105 record ratio  8 number  1       sigma  1   reps  8
d  105 record ratio  6 number  1       sigma  1   reps  6
d  105 record ratio  5.27835051546392 number  193       sigma  194   reps  1024
d  105 record ratio  5.37931034482759 number  173       sigma  174   reps  936
d  105 record ratio  5.30952380952381 number  167       sigma  168   reps  892
d  105 record ratio  5.375 number  191       sigma  192   reps  1032
d  105 record ratio  5.26666666666667 number  179       sigma  180   reps  948
d  105 record ratio  6 number  1       sigma  1   reps  6
d  105 record ratio  5.28 number  199       sigma  200   reps  1056
d  105 record ratio  6 number  1       sigma  1   reps  6
d  105 record ratio  5.29032258064516 number  61       sigma  62   reps  328
d  108 record ratio  12 number  1       sigma  1   reps  12
d  108 record ratio  6.6 number  199       sigma  200   reps  1320
d  108 record ratio  6.609375 number  127       sigma  128   reps  846
d  108 record ratio  6.65853658536585 number  163       sigma  164   reps  1092
d  108 record ratio  8 number  1       sigma  1   reps  8
d  108 record ratio  7.46666666666667 number  29       sigma  30   reps  224
d  108 record ratio  7.15909090909091 number  129       sigma  176   reps  1260
d  108 record ratio  7.15909090909091 number  129       sigma  176   reps  1260
d  108 record ratio  6.74747474747475 number  197       sigma  198   reps  1336
d  108 record ratio  6.64367816091954 number  173       sigma  174   reps  1156
d  108 record ratio  6.63636363636364 number  197       sigma  198   reps  1314
d  108 record ratio  6.66666666666667 number  11       sigma  12   reps  80
d  108 record ratio  9.9 number  199       sigma  200   reps  1980
d  108 record ratio  7.22222222222222 number  159       sigma  216   reps  1560
d  108 record ratio  9.8989898989899 number  197       sigma  198   reps  1960
d  109 record ratio  12 number  1       sigma  1   reps  12
d  109 record ratio  6 number  1       sigma  1   reps  6
d  109 record ratio  5.33333333333333 number  5       sigma  6   reps  32
d  109 record ratio  6 number  1       sigma  1   reps  6
d  109 record ratio  4.5 number  3       sigma  4   reps  18
d  112 record ratio  12 number  1       sigma  1   reps  12
d  112 record ratio  6 number  3       sigma  4   reps  24
d  112 record ratio  6 number  1       sigma  1   reps  6
d  112 record ratio  5.93406593406593 number  181       sigma  182   reps  1080
d  112 record ratio  6 number  1       sigma  1   reps  6
d  112 record ratio  6 number  1       sigma  1   reps  6
d  112 record ratio  5.02083333333333 number  191       sigma  192   reps  964
d  112 record ratio  5.05494505494505 number  181       sigma  182   reps  920
d  112 record ratio  5.05494505494505 number  181       sigma  182   reps  920
d  112 record ratio  6 number  1       sigma  1   reps  6
d  112 record ratio  5.06122448979592 number  97       sigma  98   reps  496
d  112 record ratio  4.57142857142857 number  194       sigma  294   reps  1344
d  112 record ratio  4.57142857142857 number  194       sigma  294   reps  1344
d  112 record ratio  4.66666666666667 number  2       sigma  3   reps  14
d  112 record ratio  5.9375 number  191       sigma  192   reps  1140
d  112 record ratio  4.55 number  158       sigma  240   reps  1092
d  113 record ratio  8 number  1       sigma  1   reps  8
d  113 record ratio  4 number  1       sigma  1   reps  4
d  113 record ratio  6 number  1       sigma  1   reps  6
d  113 record ratio  3.71428571428571 number  4       sigma  7   reps  26
d  113 record ratio  3.41666666666667 number  71       sigma  72   reps  246
d  116 record ratio  8 number  1       sigma  1   reps  8
d  116 record ratio  4.09523809523809 number  41       sigma  42   reps  172
d  116 record ratio  4.66666666666667 number  5       sigma  6   reps  28
d  116 record ratio  6 number  1       sigma  1   reps  6
d  116 record ratio  4 number  7       sigma  8   reps  32
d  116 record ratio  12 number  1       sigma  1   reps  12
d  116 record ratio  6.66666666666667 number  5       sigma  6   reps  40
d  116 record ratio  6.14285714285714 number  41       sigma  42   reps  258
d  116 record ratio  6 number  1       sigma  1   reps  6
d  116 record ratio  4.60215053763441 number  122       sigma  186   reps  856
d  116 record ratio  4.66666666666667 number  2       sigma  3   reps  14
d  117 record ratio  8 number  1       sigma  1   reps  8
d  117 record ratio  7.33333333333333 number  17       sigma  18   reps  132
d  117 record ratio  12 number  1       sigma  1   reps  12
d  117 record ratio  6.92783505154639 number  193       sigma  194   reps  1344
d  117 record ratio  6.94736842105263 number  151       sigma  152   reps  1056
d  117 record ratio  6.92783505154639 number  193       sigma  194   reps  1344
d  117 record ratio  6.04615384615385 number  171       sigma  260   reps  1572
d  117 record ratio  6.06153846153846 number  171       sigma  260   reps  1576
d  117 record ratio  6.97619047619048 number  167       sigma  168   reps  1172
d  117 record ratio  6.98550724637681 number  137       sigma  138   reps  964
d  120 record ratio  8 number  1       sigma  1   reps  8
d  120 record ratio  6.25287356321839 number  173       sigma  174   reps  1088
d  120 record ratio  6.30952380952381 number  167       sigma  168   reps  1060
d  120 record ratio  12 number  1       sigma  1   reps  12
d  120 record ratio  6.43298969072165 number  193       sigma  194   reps  1248
d  120 record ratio  6.30927835051546 number  193       sigma  194   reps  1224
d  120 record ratio  6.36734693877551 number  97       sigma  98   reps  624
d  120 record ratio  6.48484848484848 number  131       sigma  132   reps  856
d  120 record ratio  6.54545454545455 number  131       sigma  132   reps  864
d  120 record ratio  6.4 number  89       sigma  90   reps  576
d  120 record ratio  6.31111111111111 number  179       sigma  180   reps  1136
d  120 record ratio  6.41758241758242 number  181       sigma  182   reps  1168
d  120 record ratio  6.61818181818182 number  109       sigma  110   reps  728
d  120 record ratio  6.46153846153846 number  181       sigma  182   reps  1176
d  121 record ratio  4 number  1       sigma  1   reps  4
d  121 record ratio  6 number  1       sigma  1   reps  6
d  121 record ratio  4 number  2       sigma  3   reps  12
d  124 record ratio  12 number  1       sigma  1   reps  12
d  124 record ratio  6 number  1       sigma  1   reps  6
d  124 record ratio  4.61904761904762 number  41       sigma  42   reps  194
d  124 record ratio  4.19354838709677 number  25       sigma  31   reps  130
d  124 record ratio  5.33333333333333 number  5       sigma  6   reps  32
d  124 record ratio  4.30769230769231 number  9       sigma  13   reps  56
d  124 record ratio  6 number  1       sigma  1   reps  6
d  124 record ratio  4 number  47       sigma  48   reps  192
d  124 record ratio  4.02439024390244 number  163       sigma  164   reps  660
d  125 record ratio  8 number  1       sigma  1   reps  8
d  125 record ratio  12 number  1       sigma  1   reps  12
d  125 record ratio  6.15625 number  127       sigma  128   reps  788
d  125 record ratio  6.32432432432432 number  73       sigma  74   reps  468
d  125 record ratio  6 number  103       sigma  104   reps  624
d  125 record ratio  6 number  1       sigma  1   reps  6
d  125 record ratio  9.8989898989899 number  197       sigma  198   reps  1960
d  125 record ratio  7.89473684210526 number  185       sigma  228   reps  1800


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

• For how long do you get a simple formula (i.e. no cusp form contributions)? For how high a discriminant can you explicitly prove the bounds you are stating? I want to see how far we are from "linking up". I can now give explicit bounds that aren't too shabby, modulo the cusp form contributions. Dec 12, 2016 at 12:07
• @WillSawin I don't think I remember how to calculate representation counts for a positive form. It has been a long time. I just ran these forms from Nipp's tables, up to bound 200 this time. In particular, the part about 15 sigma and 20 sigma is purely observation. Dec 12, 2016 at 17:47
• Well let's try to guess by reading the table. We can guess that for forms where the maximum ratio is achieved for $n$ large, that in fact the ratio is an asymptotic. That means it's unlikely that there is a cusp form contribution - otherwise we would get above the asymptotic for low $n$. On the other hand, when the maximum is achieved for $n$ small, I think we can guess the reverse. Dec 12, 2016 at 17:52
• @WillSawin the person I know who is really quick with local densities is Shimura student Jon Hanke, of the 290 theorem. He now works for a financial math place in Princeton, probably visits Bhargava and some math talks there; he does juggling on campus, there is a club. wordpress.jonhanke.com Dec 12, 2016 at 17:53
• @WillSawin messages out of sync. If I can figure out your email I can send you two things, the full run I did but just the record ratios, along with the much larger file giving a pretty full statement for each form. Let me try sending you some text files, begin with that. Dec 12, 2016 at 17:56

Too long for comment.

$r_Q(n) \le 24 \sigma(n)$ is false according to my computations.

Take $Q=x^2+y^2+z^2+w^2+x y+x z+x w+y z+y w+z w$.

The sigma inequality fails at least for $n \in \{13, 17, 23, 37, 43\}$ and the ratio $r_Q(n)/\sigma(n)$ is increasing as $n$ increases.

Checked for the unknowns in the range $[-n,n]$.