Suppose we count all triplets A1, A2, A3 that have exactly r elements in common.
The number of ways such triplets can be formed is counted as:
(i) we can choose the r>0 elements to be chosen in nCr ways. Now, the remaining (n-r) elements have each the following choices
(a) they can be part of exactly one set in 3 ways
(b) they can be part of exactly two sets in 3 ways
making available 6 choices for each element
Hence number of such triplets is nCr 6n-r. for r>0
So the required sum is

This is a regular sum that can be obtained by differentiating (x+6)n and putting x=1