Counting Happy Numbers in Mathematica

Snippit of Wolfram to count Happy Numbers

Partitioning Sets

Make pairwise comparisons between every possible combination of subsets. How many comparisons do we end up making?