The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A007974 Number of permutations that are n-3 "block reversals" away from 12...n. 4
1, 6, 52, 389, 2539, 16604, 105365, 654030, 3900116 (list; graph; refs; listen; history; text; internal format)
OFFSET
3,2
LINKS
FORMULA
a(n) = A300003(n,n-3).
PROG
(Python)
def a(n):
perm = tuple(range(1, n+1)); reach = {perm}; frontier = {perm}
for k in range(n-3):
r1 = set()
while len(frontier) > 0:
q = frontier.pop()
for i in range(n):
for j in range(i+1, n+1):
qp = list(q)
qp[i:j] = qp[i:j][::-1]
qp = tuple(qp)
if qp not in reach:
reach.add(qp)
r1.add(qp)
frontier = r1
return len(frontier)
print([a(n) for n in range(3, 10)]) # Michael S. Branicky, Jan 26 2023
CROSSREFS
Sequence in context: A292053 A202925 A287082 * A027111 A083301 A334978
KEYWORD
nonn,more
AUTHOR
EXTENSIONS
a(9)-a(11) from Sean A. Irvine, Feb 22 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 18 01:23 EDT 2024. Contains 372608 sequences. (Running on oeis4.)