My attempt:
$x_1+x_2+x_3+x_4 = n$
So the generating function
$g(x) = (1+x+x^2+x^3)(1+x^2+x^4+...)(1+x+x^2+x^3+...)(1+x+x^2+x^3+...)$
$g(x) = \frac{1-x^4}{1-x}\frac{1}{1-x^2}\frac{1}{1-x}\frac{1}{1-x}$
$g(x) = \frac{1+x^2}{(1-x)^3}$
My attempt:
$x_1+x_2+x_3+x_4 = n$
So the generating function
$g(x) = (1+x+x^2+x^3)(1+x^2+x^4+...)(1+x+x^2+x^3+...)(1+x+x^2+x^3+...)$
$g(x) = \frac{1-x^4}{1-x}\frac{1}{1-x^2}\frac{1}{1-x}\frac{1}{1-x}$
$g(x) = \frac{1+x^2}{(1-x)^3}$
Copyright © 2021 JogjaFile Inc.
You can proceed further and using the binomial theorem find the closed form of the answer: $$ [x^n]\frac{1+x^2}{(1-x)^3}=[x^n](1+x^2)\sum_{k=0}^\infty\binom{-3}k(-x)^k= [x^n](1+x^2)\sum_{k=0}^\infty\binom{k+2}2x^k= \binom{n+2}2+\binom n2, $$ where $[x^n]$ is the coefficient extractor, which gives the coefficient at $x^n$ in the series expansion of the following expression.
Above we used the identity: $$ \binom{-n}k=(-1)^k\binom{n+k-1}k=(-1)^k\binom{n+k-1}{n-1}. $$