First of all we know for a given table one of primary or clustered index can exist but not both..In contrast , there can be multiple secondary indices which can be accomodated at the same time.
So basically with n attributes we can have any index having any number of attributes and order of attributes will matter as change of order of attributes for key formation will result in formation of different index.So it is a question of permutation rather than combination(selection).
So no of indices that can be built using 1 attribute only = Permutation of 1 object at a time from n objects
= nP1
Similarly no of indices that can be built using 2 attributes at a time = nP2
...
So we continue this till the point we can have n attributes for secondary index which can be done in nPn ways.
So substituting n = 5 , we have :
No of secondary indices possible = 5P1 + 5P2 ...........+ 5P5
= (5! / 4!) + (5! / 3!) + (5! / 2!) + (5! / 1!) + (5! / 0!)
= 5 + 20 + 60 + 120 + 120
= 325
Hence no of secondary indices possible with 5 attributes = 325