Major Index and Inversion Number of Permutations