Asymptotic formula for the number of ways to write a number as the sum of $k$ triangular numbers How would one derive an asymptotic formula for the number of representations of a number $n$ as the sum of $k$ numbers of the form $\frac{m(m + 1)}{2}$
I think that one could use the circle method, but I don't know how to deal with the extra term in the $\frac{m^2 + m}{2}$. 
 A: The modular forms approach is to realize these representation numbers as Fourier coefficients of a modular form, and write this as a cusp form plus an Eisenstein series.  Then the Fourier coefficients of the Eisenstein series will dominate.  I had some students work things out explicitly (when $4 | k$, where things are simpler) as a summer project a few years ago.  Here is a link to the project page with their work (the second project):
http://www.math.columbia.edu/programs-math/undergraduate-program/summer-undergraduate-research/2007-2/
A: Use circle method detect the condition $N=\sum_{i=1}^k \frac{m_i(m_i+1)}{2}$ to derive
$r(N)=\int_0^1  f^k(\alpha) e(-N\alpha)$, where  $f(\alpha)=\sum_{n\leq  N} e(\alpha \frac{m_i(m_i+1)}{2} )=\int_{major arcs}+\int_{minor arcs}$by Dirichlet approximating lemm. Writing  $f(\alpha)=\sum_{m\leq N} e( (\frac{a}{q}+\lambda) \frac{m(m+1)}{2} )$ and $m = qt + s$ with $s \leq q,\frac{1-s}{q} \leq t \leq\frac{N-s}{q}$.$$f(\alpha)=\sum_{m\leq N}e( (\frac{a} {q}+\lambda) \frac{(qt + s)(qt + s+1)}{2} )=\sum_{s\leq q}e(\frac{a}{q}\cdot \frac{s(s+1)}{2})\times \sum_{\frac{1-s}{q} \leq t \leq\frac{N-s}{q}}e(\lambda  \frac{(qt + s)(qt + s+1)}{2} ).$$since $ \sum_{\frac{1-s}{q} \leq t \leq\frac{N-s}{q}}e(\lambda  \frac{(qt + s)(qt + s+1)}{2} )=\frac{1}{q}\sum_{m\le N}e(\lambda \frac{m(m+1)}{2})+o(1),$ we have $f(\alpha)=\frac{c_q(a)}{q}\sum_{m\leq N}e(\lambda \frac{m(m+1)}{2})+o(q)$ with $c_q(a)=\sum_{s\leq q}e(\frac{a(\frac{s(s+1)}{2})}{q})$ bounded by $\ll q^{1/2}$. Eventually we have $r(N)=\sigma(N,P)J(N)+errorterm$. Here $P$ is the upper bound for $q$ in the arcs division( that is, major arcs: $\cup_{q\le P}\cup_{(a,q)=1,a\leq q} M(a,q)$, with $M(a,q)=[\frac{a}{q}-\frac{1}{qQ},\frac{a}{q}+\frac{1}{qQ}] $.minor arcs:$[\frac{1}{Q},1+\frac{1}{Q}]-$major arcs), and could be taken $log^A N$ for any $A$,$\sigma(N,P)=\sum_{a\leq q,(a,q)=1}(\frac{c_q(a)}{q})^ke(-\frac{aN}{q})$,and $J(N)=\int_{-\frac{1}{qQ}}^{\frac{1}{qQ}}(\sum_{m\le N}e(\lambda \frac{m(m+1)}{2}))^ke(-N \lambda)d \lambda$.
