Wolfram Language (Mathematica), 56 49 46 bytes
f[n_,a_]=If[n<=0,Boole[n==0],Tr[f[n-#,a]&/@a]] This borrows the method used by Arnauld's answer.
Initial solution:
Length[Join@@Permutations/@IntegerPartitions[#,∞,#2]]& f[n_,a_]=If[n<=0,Boole[n==0],Tr[f[n-#,a]&/@a]] This borrows the method used by Arnauld's answer.
Initial solution:
Length[Join@@Permutations/@IntegerPartitions[#,∞,#2]]&