The answer given is incorrect. The number of moves required to solve the puzzle should be this sequence, given by $(n^2+n-2)/2$ (where $n=\#\text{ of frogs}$).
Let's write the formation of the frogs as a string of numbers $ 0$ through $ n$, denoting the empty space by $ 0$. With this notation, we can see that each turn is defined by swapping the $ 0$ with the number one or two spaces to the left or right, corresponding to a frog on the left or right hopping or leaping to the right or left, respectively. Since we'll be focusing on the $ 0$, it will be easiest to say that the $ 0$ is leaping to the left when a frog is leaping to the right, and analagously for the other cases.
Now, for aesthetics, we can consider the formations as vertices of a layered tree, each layer of the tree corresponding to a turn of the frog moving game. We put a directed edge from formation $ a$ (in layer $ i$) to formation $ b$ (in layer $ i+1$) if a legal move takes us from $ a$ to $ b$. Viewed in this way we can consider the puzzle as a shortest path problem from $ 0123\ldots n$ to $ n\ldots 3210$ (or to $ n\ldots 3201$, $ n\ldots 3021$, $ n\ldots 0321$, etc). Since we are interested only in shortest paths, the layers of the tree will be disjoint, as moving to an in-neighbor would imply we could have gotten there in fewer moves.
The Even Case.
I find the even case a bit easier to visualize, so let's start with that. Here is what the puzzle looks like with $ 4$ frogs.
You can see there are several solutions, highlighted in red, with the shortest one bolded. Let's zoom into these paths and walk through them.
Every solution follows the same pattern. First, the $ 0$ is moved all the way to the right, then reverses direction. We don't want to undo our previous move, so there is only one one available option - if we leaped right, we need to hop left, and vice versa. When we get $ 0$ back to the leftmost position, we reverse direction again. This process repeats until all the numbers are in order. (See: "Why does this work?") The fastest way to do this is highlighted in the red path - every move to the right is a leap, and there are exactly two hops to the left.
If we say that moving $ 0$ all the way to the right, then all the way back to the left constitutes a "round," then each round takes $ n/2$ leaps to the right + $ 1$ hop to the left + $ (n-2)/2$ leaps to the left + $ 1$ hop to the left. That's $ n+1$ total moves, $ 2$ hops and $ n-1$ leaps. Since each round moves the biggest number to the left twice and the smallest number to the right twice, we only need to do this $ n/2$ times to get everything in order. Also, we can skip the last step (which would only serve to put $0$ on the far left), so the even case requires $$ \frac{n(n+1)}{2}-1 =\frac{n^2+n-2}{2} \text{ moves}$$ with $$\frac{n(n-1)}{2}\text{ leaps}$$ and thus $$n-1\text{ hops.}$$
The Odd Case.
For $5$-frogs, the full diagram is too big, but we can look at its solutions.
Here is where we diverge from the answer given. We can do it in $ 14$ moves, $ 2$ less than $ (5^2+3\times 5)/2-4=16$.
We use essentially the same strategy here as in the even solutions. Let's write out the algorithm explicitly. The starting formation is $ 0123\ldots n$ and the starting direction is $ d=1$. Every turn, check first if $ 0$ is at position $ 1$ or $ n-1$. If it's at position $ p_0= 1$, let the $ 0$ hop left to position $ 0$ and set $ d=1$. If it's at position $ p_0= n-1$, have the $ 0$ hop right to position $ n$ and set $ d=-1$. In any other position $p_0$, the $ 0$ leaps to position $ p_0+2d$. We continue in this manner until the frogs are in the formation $ n\ldots 3201$.
Again we can see that each round has $n+1$ moves, $n-1$ leaps and $2$ hops (now in opposite directions). After completing $ k$ rounds, there are $ 2k-1$ numbers to the right of $ n$. If we do this $ (n-1)/2$ times, we have $ n-2$ numbers to the right of $ n$. In this situation, we only need to complete a 'half round' to finish - that is, once we get $ 0$ back to position $ n-1$, everything will be complete. That's $ (n-1)/2$ leaps, so we have a total of $$\left(\frac{n-1}{2}\right)(n+1)+\frac{n-1}{2}=\frac{n^2+n-2}{2} \text{ moves, }$$
which breaks down to
$$\left(\frac{n-1}{2}\right)(n-1)+\frac{n-1}{2}=\frac{n(n-1)}{2} \text{ leaps }$$
and
$$2\left(\frac{n-1}{2}\right)=n-1 \text{ hops.}$$
Why does this work?
Luckily we can understand our solution using some permutation theory. Let's prove it works for the odd case. Taking $0$ from left to right induces the permutation $$(0,n,n-1,n-3,n-5,n-7,\ldots,8,6,4,2)$$ in $\text{Sym}(\{0,\ldots,n\})$. Taking it from right to left induces the permutation $$(0,1,3,5,7,9,\ldots,n-4,n-2,n).$$ Multiplying these permutations, we get $$\sigma:=(1, 3, 5, 7, 9, 11,\ldots, n,n-1,\ldots,10,8,6, 4, 2).$$ So if we let $\sigma=(\sigma_1,\ldots,\sigma_{n})$, then we have that $$\sigma_k=\left\{\begin{array}{lcl}2k-1&:&k=1,\ldots,\frac{n+1}{2}\\ 2 (n - k + 1) &:&k=\frac{n+1}{2}+1,\ldots,n\end{array}\right.$$ where the indices are taken mod $n$.
Let $m=(n-1)/2$. We have, in general, that in cycle notation we can write $$(i_1,i_2,i_3,\ldots,i_c)^{m}=(i_{1+m},i_{1+2m},i_{1+2m},\ldots,i_{1+cm}),$$ where the indices are taken modulo $c$. From this we obtain
$$\begin{eqnarray*}\sigma^{m}&=&(1, 3, 5, 7, \ldots, 2m+1,2m,\ldots,8,6, 4, 2)^{m}\\&=&(2,n-2,4,n-4,\ldots,m+1,m,\ldots,3,n-1,1,n).\end{eqnarray*}$$
Applying this permutation to $0,\ldots,n$ yields the formation $$0,n-1,n,n-3,n-2,n-4,n-3,\ldots,5,2,3,1.$$ So now, we can see that we just need to leap $n$ to the left, then $n-2$, then $n-3$, etc. until we reach $n,n-1,n-2,\ldots,3,2,0,1$.
The even case is proven identically.
How do we know this is the smallest possible number?
Every move can at most reverse the order of $2$ frogs. We must put frog $n$ to the left of all $n-1$ of the other frogs, so that is at least $n$ leaps right there. This does not modify the order of the other frogs, so to move frog $n-1$ to be to the left of the $n-2$ remaining frogs, we will need at least $n-2$ leaps. Continuing in this fashion, we need at minimum $$\sum_{k=1}^{n-1}k=\frac{n(n-1)}{2}$$ leaps. However, discussed above, we need $1$ hop each for frogs $2$ to $n$ to change direction, so we need at least $$\frac{n(n-1)}{2}+n-1=\frac{n^2+n-2}{2}$$ moves. Thus our construction is of minimal length.
Theorem. No sequence of moves transforms the board below on the left into the board below on the right.
1. row A B C D A B C D
2. row E F G H E F G H
3. row I J K L I J K L
4. row M O N M N O
a) Can a row move change the order of the tiles?
A row move can change the position of a tile only +1 or -1, but the position of no other tile changes. So a row move can never change the order of tiles.
b) How many pairs of tiles will have their relative order changed by a column move?
A column move changes the order of a tile either -4 or +4. When the tile is moved down, it moves in front of the next 3 tiles. When the tile is moved up, it moves behind the previous 3 tiles. Hence a column move changes the relative order for 3 pairs of tiles.
c) We define an inversion to be a pair of letters L1 and L2 for which L1 precedes L2 in the alphabet, but L1 appears after L2 in the order of the tiles.. What effect does a row move have on the parity of the number of inversions??
As a row move doesn't change the order of tiles, a row move has no effect on the number of inversions, so the parity stays the same.
d) What effect does a column move have on the parity of the number of inversions? Prove your answer.
As a column move changes relative order of 3 tiles, the number of inversions is flipped to the opposite, from even to odd and from odd to even.
e) The previous problem part implies that we must make an odd number of column moves in order to exchange just one pair of tiles (N and O, say). But this is problematic, because each column move also knocks the blank square up or down one row. So after an odd number of column moves, the blank can not possibly be back in the last row, where it belongs! Now we can bundle up all these observations and state an invariant, a property of the puzzle that never changes, no matter how you slide the tiles around.
Lemma: In every configuration reachable from the position shown below, the parity of the number of inversions is different from the parity of the row containing the blank square.
1. row A B C D
2. row E F G H
3. row I J K L
4. row M O N
Proof of the lemma by induction:
Base case:
After 0 moves, there is exactly 1 inversion (odd) and the row number of the blank square is 4 (even).
Inductive step:
If a row move happens, the row number of the blank square doesn't change, neither does the number of inversions change.
If a column move happens, the parity of the number of inversions is flipped (+3 or -3). Also, the parity of the row number of the blank square is flipped (+1 or -1). Given the start state with odd number of inversions and even row number for the blank square, the parity of those two variables will continue to differ after flipping them both to the opposite side.
e) Prove the theorem that we originally set out to prove.
As per the lemma, the parity of the number of inversions will always be different from the parity of the the row number for the blank square. In the desired end state their parity is equal, which will never be possible given the start state where those two variables have different parity.
Best Answer
This can be shown using some elementary abstract algebra.
In short, a puzzle configuration is not solvable if and only if it's an odd number of swaps away from the solved state, like the one in your image is (14 and 15 swapped = 1 swap). I used this fact a few years ago to quickly generate random configurations for a 15-puzzle app I used to have in the App Store.
Reference: https://kconrad.math.uconn.edu/blurbs/grouptheory/15puzzle.pdf