Function to find the total number of combinations possible
function findPermutations ( n ) { var sum = 0 , P ; for ( var r = 1 ; r <= n ; r ++ ) { P = permute ( n , r ) ; sum = sum + P ; } return sum ; }