Let $B'=B\cup\{\infty\}$, where $\infty$ isn't a button. If you partition $B'$ into $k>1$ sets, that determines $k-1$ combinations - the partition with $\infty$ isn't counted - and there are $(k-1)!$ ways to order those combinations into a sequence. So $$\sum_{k=2}^{|B|+1} (k-1)!p_k(B')$$ is the count required, where $p_k(X)$ is the number of ways of partitioning a set $X$ into $k$ non-empty sets.
Now $p_n(X)=S(|X|,k)$ is the Stirling number of the second kind. So if $n=|B|$ then $|B'|=n+1$ and we get the numbers:
$$\sum_{k=2}^{n+1} (k-1)!S(n+1,k)$$
Using data from Wikipedia, we have $S(4,2)=7,S(4,3)=6,S(4,4)=1$. That yields, for $|B|=3$, the formulation:
$$1!\cdot 7 + 2!\cdot 6 + 3!\cdot 1 = 25$$
which is the value posted by user paw in comments, and disagrees with your 45.
For $n=1,2,3$ we get $1,5,25$, which is interesting.
For $|B|=4$, though, we get:
$$1!\cdot 15+2!\cdot 25 +3!\cdot 10 + 4!\cdot 1 = 149$$
Wikipedia's formula for $S(n,k)$ might be useful:
$$S(n,k) =\frac{1}{k!}\sum_{j=0}^k (-1)^{k-j}\binom{k}{j}j^n$$
Yielding:
$$\sum_{k=2}^{n+1}\frac{1}{k}\sum_{j=0}^k(-1)^{k-j} \binom{k}{j}j^{n+1}$$
A slightly different counting approach gives:
$$1+2\sum_{k=2}^n k!S(n,k)$$
For example, when $n=4$ this is $$1+2\left( 2!\cdot S(4,2)+3!\cdot S(4,3)+4!\cdot S(4,4)\right)=1+2\cdot 74=149$$
(The counting argument is as follows. We take a partition of $B$ into $k$ parts. We can use either all $k$ parts as combinations, in any order, or, when $k>1$, we can also use only $k-1$ parts. That gives us $2k!$ answers contributed by this partition.)
This formula might be better because Wikipedia says that:
$$a_n=\sum_{k=0}^{n} k!\cdot S(n,k)$$ is something called the $n$th "ordered Bell number," and the count we are looking for, for $n>0$, is thus equal to $2a_n-1$. Ordered Bell numbers (or Fubini numbers) are listed on the OEIS page as sequence number A000670.
We want to find a word over the alphabet $\{1,\ldots,n\}$ that is as short as possible and contains all $n!$ permutations of the alphabet as infixes.
Let $\ell_n$ denote the shortest achievable length.
Clearly, $$\tag1\ell_n\ge n!+(n-1).$$
Of course, $(1)$ is somewhat optimistic because it requires $(n-1)$-overlaps between all consecutive permutations, but that is only possible for cyclicly equivalent permutations. As there are $(n-1)!$ equivalence classes under cyclic equivalence, and switching between these requires us to "waste" a symbol, we find that
$$\tag2\ell_n\ge n!+(n-1)+(n-1)!-1=n!+(n-1)!+(n-2).$$
In particular, inequality $(2)$ is sharp for the first few cases $\ell_1=1$, $\ell_2=3$ (from "121"), $\ell_3=9$ (from "312313213").
However, it seems that that $\ell_4=33$ (from "314231432143124313421341234132413").
Feeding these few values into the OEIS search engine reveals http://oeis.org/A180632 and we see that the exact values seem to be known only up to $\ell_5=153$ (which is your original problem)!
Quoting the known bounds from there, we have
$$ \ell_n\ge n! + (n-1)! + (n-2)! + n-3$$
(which can supposedly be shown similarly to how we found ($2)$ above) and
$$\ell_n\le \sum_{k=1}^nk!.$$
These bounds tell us that $152\le l_5\le 153$, but it has been shown in 2014 that in fact $\ell_5=153$.
The next case seems to be still open: The inequalities only tell us $867\le \ell_6\le 873$, but another result of 2014 shows that $\ell_6\le 872$.
Best Answer
Let's do (1) and you can finish (2) yourself.
You get $$\binom{n}{m} m! = \frac{n!}{(n-m)!}$$
UPDATE This takes care of any fixed $m$. To get the result for different $m$, add different possibilities: $$ \sum_{k=1}^m \frac{n!}{(n-k)!} $$