The first of my questions may be entirely elementary, but the second (closely related) question may be of appropriate interest for this site.


Suppose that we are given $w\_1, w\_2, \cdots, w\_n$ of positive integers which are co-prime. Let $H > 1$ be a positive parameter. I am interested in evaluation the sum


$$\displaystyle \sum\_{w\_1 x\_1 + \cdots + w\_n x\_n \leq H} (w\_1 x\_1 + \cdots + w\_n x\_n)$$


I think the sum can be expressed in the form $c\_0 H^{n+1} + O(H^{n})$ for some positive constant $c\_0 > 0$, and if this is the case then I want to know what $c\_0$ is in terms of the weights $w\_1, \cdots, w\_n$.


Second question is for general weights $w\_1, \cdots, w\_n$, where these are positive real numbers (but not necessarily integers), can we obtain the same result? Since a counting argument is not so clear here, what would be the way to show it?


Thanks for any insights.



Values of various weighted sums
**new answer** I think that the sum will be $$\frac{n}{w\_1w\_2\dots w\_n}\binom{H+n}{n+1}+o(H^{n}).$$ I do not think that it matters if the positive values $w\_i$ are integers nor (if they are) if they are relatively prime. If my calculations are correct, then in the special case that $w\_1=w\_2=\dots=w\_n=1$ and $H$ is an integer, the sum comes out to exactly $n\binom{H+n}{n+1}.$ 


As an experiment: with $w\_1=e,w\_2=\pi,w\_3=\sqrt{17}$ and $H=1000$ the exact sum (to the nearest integer) is $3,597,483,570$ while the estimate is $3,571,444,698.$


**old answer** I think that $c\_0H^{n+1}$ seems more likely. 


In the special case $n=1, w\_1=1$ you would have the sum of all the integers up to $H$ and hence $\frac{H(H+1)}{2}$ (We may as well assume $H$ is an integer.) In general for $n=1$ we can assume that $H=kw\_1$ and get $\frac{1}{2w\_1}H^2+O(H).$ 


The case that there are $n$ $w\_i$ all equal to 1 might fit the description and be worth working out.


The case $n=2$ with $w\_1=1$ is the sum $$\sum\_{x\_2=0}^{\lfloor H/w\_2 \rfloor}\ \sum\_{j=0 }^{H-x\_2w\_2}(x\_2w\_2+j)$$ which could be exactly worked out without too much grief and is clearly $c\_0H^3+O(H^2).$


In general one could pull out $w\_1$, (say the smallest of the relatively prime $w\_i$) and then add the sums for $H,H-w\_1,H-2w\_1,\dots$ with the weights $w\_2,\dots,w\_n$ 


