If order doesn't matter, you can use
${n \choose 0} + {n \choose 1} + {n \choose 2} + \dots + {n \choose n} = 2^n$
The intuition here is that we're simply summing up all the possible combinations of different length-ed sets. We start with the combinations of length zero (there's only one - the empty set), and then add the combinations of length one (there's $n$ of them), etc. until we get to adding the combinations of length $n$ (there's only one).
Johanna's answer gives a good intuition of the $2^n$ value. Another way to think about it, is whenever we add a new element to the set, it must cause the number of possible subsets of that set to double in size. Think about it: All the previous possible subsets are still possible, but now we can create a copy of each of them that contains the new element - in doing so we double the number of possible subsets.
If order does matter you can use: ${n \choose 0}0! + {n \choose 1}1! + {n \choose 2}2! + \dots + {n \choose n}n!$
All we do here is multiply each element in the last equation by the number of different arrangements that are possible for each length. If, for example, we're considering a set of 7 elements, there are $7!$ different ways of rearranging that set. Note that this assumes that your set elements are unique (i.e. it's a proper set). If you have duplicate elements, don't use this formula (because, for example, it will count the ordered set AAB
twice, given that we can switch the positions of the A
s).
Perhaps an easier way to think about the ordered case it we're just summing permutations of each possible length: $^n P_0 + ^n P_1 + ^n P_2 + \dots + ^n P_n $