this should be a complete answer....

from my previous answer:

for i = 1:

P(8,8) = 8!

for i = 2:

for 1 tie: C(8, 2) * P(7, 7) = 8!/(6!2!) * 7!

for 2 ties: C(8,2) * C(6,2) * P(6,6) = 8!/(6!2!) * 6!/(4!2!) * 6!

for 3 ties: C(8,2) * C(6,2) * C(4,2) * P(5,5) = " * " * 4!/4 * 5!

for 4 ties: C(8,2) * C(6,2) * C(4,2) * C(2,2) * P(4,4) = " * " * " * 2 * 4!

for i = 3:

for 1 tie: C(8,3) * P(6,6) = 8!/(5!3!) * 6!

for 2 ties: C(8,3) * C(5,3) * P(4,4) = 8!/(5!3!) * 5!/(3!2!) * 4!

for i = 4:

for 1 ties C(8,4) * P(5,5) = 8!/(4!4!) * 5!

for 2 ties C(8,4) * C(4,4) * P(2,2) = 8!/(4!4!) * 1 * 2

for i = 5:

only 1 tie possible: C(8,5) * P(4,4) = 8!/(3!5!) * 4!

for i = 6:

" " " ": C(8,6) * P(3,3) = 8!/(6!2!) * 6

for i = 7:

" " " ": C(8,7) * P(2,2) = 16

for i = 8: 1

Therefore, the total is:

1 + 16 + 8!/(6!2!) * 6 + 8!/(3!5!) * 4! + 8!/(4!4!) * 5 * 2 +

8!/(4!4!) * 5! + 8!/(5!3!) * 5!/(3!2!) * 4! + 8!/(5!3!) * 6! +

8!/(6!2!) * 6!/(5!2!) * 4!/4 * 2 * 4! +

8!/(6!2!) * 6!/(4!2!) * 4!/4 * 5! +

8!/(6!2!) * 6!/(4!2!) * 6! + 8!/(6!2!) * 7! + 8!

*edit* fixed errors