Link to the original problem
It\'s not a homework question. I just thought that someone might know a real solution to this problem.
I was on
This is A004152 in the Online Encyclopedia of Integer Sequences. Unfortunately, it doesn't have any useful tips about how to calculate it efficiently - its maple and mathematica recipes take the naive approach.