Hi, I'm very new to Mathematica and I need help.

I need to create a function so that it will treat two numbers as identical if the sum of their digits is the same, and also removes any duplicate entries.

So far I've tried

SumOfDigits[n_] := Apply[Plus, IntegerDigits[n]] //Union

But when trying this on a list of 1 to 50 say it doesn't work. Any ideas?

BTW I also have several more problems that I need help with.

Thanks