A different solution using partitions:
n = 3; ds = Range[0, 9];
g[p_] := Multinomial[Sequence @@ Tally[p][[All, 2]]];
f[x_] := Total[g /@ IntegerPartitions[x, {n}, ds]];
f /@ Range[n Min[ds], n Max[ds]]
Total[#^2 & /@ %]
{1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 63, 69, 73, 75, 75, 73, 69, 63, 55, 45, 36, 28, 21, 15, 10, 6, 3, 1}
55252
One hundred twenty-eight binary digits? Sure.
n = 64; ds = Range[0, 1];
{1,64,2016,41664,635376,7624512,74974368,621216192,4426165368,27540584512,151473214816,743595781824,3284214703056,13136858812224,47855699958816,159518999862720,488526937079580,1379370175283520,3601688791018080,8719878125622720,19619725782651120,41107996877935680,80347448443237920,146721427591999680,250649105469666120,401038568751465792,601557853127198688,846636978475316672,1118770292985239888,1388818294740297792,1620288010530347424,1777090076065542336,1832624140942590534,1777090076065542336,1620288010530347424,1388818294740297792,1118770292985239888,846636978475316672,601557853127198688,401038568751465792,250649105469666120,146721427591999680,80347448443237920,41107996877935680,19619725782651120,8719878125622720,3601688791018080,1379370175283520,488526937079580,159518999862720,47855699958816,13136858812224,3284214703056,743595781824,151473214816,27540584512,4426165368,621216192,74974368,7624512,635376,41664,2016,64,1}
23951146041928082866135587776380551750
Sixteen hexadecimal digits? No problem, captain!
n = 8; ds = Range[0, 15];
{1,8,36,120,330,792,1716,3432,6435,11440,19448,31824,50388,77520,116280,170544,245149,346040,480412,656840,885390,1177704,1547052,2008344,2578095,3274336,4116464,5125024,6321416,7727520,9365232,11255904,13419709,15874952,18637348,21719288,25129114,28870424,32941428,37334376,42035079,47022544,52268744,57738544,63389804,69173680,75035144,80913744,86744569,92459384,97987900,103259144,108202894,112751144,116839564,120408920,123406419,125786944,127514144,128561344,128912240,128561344,127514144,125786944,123406419,120408920,116839564,112751144,108202894,103259144,97987900,92459384,86744569,80913744,75035144,69173680,63389804,57738544,52268744,47022544,42035079,37334376,32941428,28870424,25129114,21719288,18637348,15874952,13419709,11255904,9365232,7727520,6321416,5125024,4116464,3274336,2578095,2008344,1547052,1177704,885390,656840,480412,346040,245149,170544,116280,77520,50388,31824,19448,11440,6435,3432,1716,792,330,120,36,8,1}
395320344293410544
Notice that the cost can be halved because the list of order-dependent partitions count is symmetric.
Let's verify this approach by computing a few values. For n = {0, 1, 2, 3, 4, 5}, we get the following sequence: {1, 10, 670, 55252, 4816030, 432457640}. A quick look-up returns this
sequence, with an equivalent problem, a summation formula, and a Mathematica goody!