How to find a number of solutions for $x_1+x_2+\ldots+x_n=r$ where $r$ is divisible by 3 and for a given $l$ and $r$ such that $l\leq x_i \leq r$?

36 Views Asked by At

How to find a number of solutions for $x_1+x_2+\ldots+x_n=r$ where $r$ is divisible by 3 and for a given $l$ and $r$ such that $l\leq x_i \leq r$?