OFFSET
1,2
COMMENTS
Consider generating a regular expression for the permutations of a set S. We can do this by divide-and-conquer: sum over all subsets T of S of size floor(n/2), and for each subset, concatenate the (recursive) result for T to the result for S-T. For example, for S = {1,2,3,4} one gets (12+21)(34+43)+(13+31)(24+42)+(23+32)(14+41)+(14+41)(23+32)+(24+42)(13+31)+(34+43)(12+21). The length of such an expression (where one counts only elements of S) is a(n).
It is easy to prove that a(n) <= 4^n.
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..1673
Antonio Molina Lovett, Jeffrey Shallit, Optimal Regular Expressions for Permutations, arXiv:1812.06347 [cs.FL], 2018.
FORMULA
a(n) = binomial(n, floor(n/2))*(a(floor(n/2)) + a(ceiling(n/2))), a(1) = 1.
MATHEMATICA
Nest[Append[#1, Binomial[#2, Floor[#2/2]] (#1[[Floor[#2/2] ]] + #1[[Ceiling[#2/2]]] )] & @@ {#, Length@ # + 1} &, {1}, 25] (* Michael De Vlieger, Feb 07 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, Oct 13 2018
STATUS
approved