fork download
  1. [c, ~, ic] = unique(sum(dec2base((0:9999)', 10) - '0', 2)');
  2. [c' accumarray(ic', 1)]
Success #stdin #stdout 0.06s 46476KB
stdin
Standard input is empty
stdout
ans =

     0     1
     1     4
     2    10
     3    20
     4    35
     5    56
     6    84
     7   120
     8   165
     9   220
    10   282
    11   348
    12   415
    13   480
    14   540
    15   592
    16   633
    17   660
    18   670
    19   660
    20   633
    21   592
    22   540
    23   480
    24   415
    25   348
    26   282
    27   220
    28   165
    29   120
    30    84
    31    56
    32    35
    33    20
    34    10
    35     4
    36     1