We need to find the sum of all rational terms in the expansion of (1+2+3)6.
By the multinomial theorem:
(1+2+3)6=∑a+b+c=6a!b!c!6!⋅1a⋅(2)b⋅(3)c
=∑a+b+c=6a!b!c!6!⋅2b/2⋅3c/2
A term is rational when 2b/2⋅3c/2 is rational, which requires both b and c to be even.
Let b=2p and c=2q where p,q≥0 and a+2p+2q=6, so a=6−2p−2q.
We need a≥0, so p+q≤3:
| (p,q) | a | b | c | a!b!c!6!⋅2p⋅3q |
| (0,0) | 6 | 0 | 0 | 6!0!0!6!⋅1⋅1=1 |
| (1,0) | 4 | 2 | 0 | 4!2!0!6!⋅2=15×2=30 |
| (0,1) | 4 | 0 | 2 | 4!0!2!6!⋅3=15×3=45 |
| (2,0) | 2 | 4 | 0 | 2!4!0!6!⋅4=15×4=60 |
| (1,1) | 2 | 2 | 2 | 2!2!2!6!⋅2⋅3=90×6=540 |
| (0,2) | 2 | 0 | 4 | 2!0!4!6!⋅9=15×9=135 |
| (3,0) | 0 | 6 | 0 | 0!6!0!6!⋅8=1×8=8 |
| (2,1) | 0 | 4 | 2 | 0!4!2!6!⋅4⋅3=15×12=180 |
| (1,2) | 0 | 2 | 4 | 0!2!4!6!⋅2⋅9=15×18=270 |
| (0,3) | 0 | 0 | 6 | 0!0!6!6!⋅27=1×27=27 |
S=1+30+45+60+540+135+8+180+270+27=1296
The answer is 1296.