[Statistic St000750 in the FindStat database](http://www.findstat.org/StatisticsDatabase/St000750/) is a map $\operatorname{St000750} \colon S\_n \rightarrow \mathbb N\_{\geq 0}$ given by

> 
> The number of occurrences of the pattern $4213$ in a permutation.
> 
> 
> 

This is the number of length-4 substrings such that the first number is largest, the second is third-largest, the third is smallest, and the fourth is second-largest. For example, the permutation $\pi = 563214$ has $\operatorname{St000750}(\pi) = 6$ occurrences of this pattern:
$$5324, 5314, 5214, 6324, 6314, \text{and}\ 6214.$$

---

I'm interested in computing$$
 a(n) = \max \{ \operatorname{St000750}(\pi) : \pi \in S\_n\}
$$
By brute-forcing $0 \leq n \leq 9$, I get that

* $a(0) = a(1) = a(2) = a(3) = 0$,
* $a(4) = 1$,
* $a(5) = 3$,
* $a(6) = 6$,
* $a(7) = 13$,
* $a(8) = 24$, and
* $a(9) = 40$.

Moreover, this sequence does not appear in the [On-Line Encyclopedia of Integer Sequences](https://oeis.org/search?q=1%2C3%2C6%2C13%2C24%2C40&language=english&go=Search).

However, an analogous sequence for the pattern $132$ is [A061061](https://oeis.org/A061061), with a simple formula: $A061061(n) = \max\{A061061(k) + k\binom{n-k}{2} : 1 \leq k < n\}$.

Is there a way to compute this sequence which is better than brute force? If not, how can you construct a better upper bound than $a(n) \leq \binom{n}{4}$?