A061545 Number of pair-exchange / set-rotate sequences achieving the minimum length of A048200(n).
0, 2, 1, 1, 1, 2, 4, 16, 40, 512, 1472, 65536, 208896
Offset: 1
Examples
Let "r" denote rotation and "x" an exchange. For n = 5, the shortest sequence reversing "ABCDE" has length A048200(5) = 10, the only sequence doing so is "xrrxrrxrxr", so a(5) = 1. For n = 6, we have A048200(6) = 15, but there are 2 solutions of this length "xrxrrxrxrrxrrrx" and "rxrrxrxrrxrxrrx", so a(6) = 2.
Links
- Sean A. Irvine, Java program (github)
- Kevin Ryde, C Code
Programs
-
C
/* See links. */
-
Java
/* See links. */
Extensions
Sequence revised and a(9)-a(12) from Sean A. Irvine, Feb 21 2023
a(13) from Kevin Ryde, Dec 28 2024