Distinct power. Does not work for large numbers