Let c, k, d $ \in \mathbb{N} $, let a, x $ \in \mathbb{N}^k $ suppose for all i $ \leq $ k, $ x_i \leq d $, $ a_i \in \mathcal{O}(d2^i) $ and $ \sum{a_ix_i} = c $ my question is for the value of c that maximizes the number of solutions to this equation, what is a tight bound for the number of solutions to this equation for said c. I know that in the related problem of the number of solutions for a given c, when the $x_i's$ are unrestrained as c -> $ \infty $ the number of solutions is roughly $ \mathcal{O}(c^k) $.
However, my intuition tells me that constraining the $x_i$'s should reduce the maximal number of solutions to roughly $ \mathcal{O}(2^k) $ for any c, since the bounds for the $ x_i's $ guarantees zero solutions after a certain point, and the bound the $a_i's$ spreads the solution over a relatively wide range.
I know this question has some relation to work done by Richard Stanley, and I'm wondering if its actually a special case of the work of him, or someone else.
I'm kind of an abstract math noob so please ask clarifying questions if part of my question seems confusing. Also please go easy on me if this is actually a really easy problem, or related to a well known result.