Ahh, I understand now.
In both of these examples, it seems easiest to break the problem into four separate sums: (1) The inversions where the first number is odd and the second is odd; (2) those where the first is odd and the second is even; (3) those where the first is even and the second is odd; and (4) those where both are even. The total number of inversions is simply the sum of these four different scenarios, of course.
For example, for your first permutation,

,
the number of inversions where both the first and second numbers are odd is zero. That's because the odd numbers are increasing from left to right. (By the way, note that I corrected your formula once more to say "2n-2", not "2n-1". I'm pretty sure that's what you meant).
In the case of the first number being odd but the second number being even, however, the situation is different. Beginning at 1, there are no smaller even numbers to its right. Moving down two places to the 3, there is exactly one even number to its right (the number 2). Moving on to 5, there are two even numbers to its right (the numbers 4 and 2). This pattern of increasing by one for each subsequent odd number continues until you get to the vicinity of half-way through, where you get to the point that ALL of the evens to the right of the odd number in question are less than it, so they all represent inversions. At this point, the total number of inversions begins to go DOWN by one every time you move over to the right (that's because every time you move one odd number higher, there is one fewer even number remaining to its right).
If you write this out for increasing values of
n, you'll see that the pattern goes something like:
1 1; 1 2 1; 1 2 2 1; 1 2 3 2 1; 1 2 3 3 2 1; 1 2 3 4 3 2 1; etc.
Unfortunately, the formula for this sum is slightly different depending on whether 2
n is evenly divisible by 4 (i.e. whether
n is even or odd). If
n is even, the sum works out to

. If it's odd, the sum is

.
Now you can do the same thing for the other two scenarios (when the first number is even). The even-even case is again quite trivial; the even numbers are decreasing to the right. Therefore the number of even-even inversions is simply the sum of the number of even numbers to the right of each even number. That should work out to (
n-1) + (
n-2) +... 1 + 0, which should work out to
}{2})
.
I'll let you take a crack at the even-odd scenario and try the second example on your own. Let me know if you get stuck. I don't know whether this is true or not, but hopefully you'll find that the even-odd scenario for the first example also has a slightly different answer depending on whether
n is even or odd, and hopefully you'll furthermore find that when you add the even-odd and odd-even sums together, the
n-being-even-or-odd differences will wash out. That would make the answer a lot more elegant.
Let me know how it works out!