tally[sort[flatten[table[(a+b),{a,1,3},{b,1,3}],1]]]