I want to find all the solutions to the equation $a+2b+3c+4d+5e+6f+7g+8h+9i=45$ where all of the variables can only be of $3$ values: $0,1,2$
I know there are a few solutions for example, set all of them to be $1$, or $a=1, b=2, c=0, d=1, e=0, f=2, g=1, h=1, i=1$.
I tried to turn them all into mod $3$ and I got:
$a+2b+d+2e+g+2h\equiv 0 \pmod 3$ but I don't know what to do after that.
I understand that there may be ~$7\times 10^{20}$ solutions
Since all variables may assume one of $3$ values, the candidate space is only $3^9$ and a one-liner brute-force Python program will count the solutions for us:
The answer is $547$. There is no simple general way to count solutions to partition problems like this where the variables have multiplicative coefficients behind them.