OFFSET
1,3
COMMENTS
The 1324-avoiding permutations of [n] partition into two classes by position of n: (1) n in final position, counted by A000108(n-1); (2) n in interior position, counted by a(n). Machine-verified theorem (Coq, proven): A permutation [sigma, n] avoids 1324 if and only if sigma avoids 132, establishing that class (1) bijects with 132-avoiding permutations.
Shares first four terms with A000305 but differs at a(6): 471 vs 466.
LINKS
Charles C. Norton, 1324-Avoiding Permutation Coq formalization
EXAMPLE
a(3) = 4: The 6 permutations of {1,2,3} all avoid 1324. Two have 3 at the end: (1,2,3), (2,1,3). The remaining 4 have 3 in an interior position: (3,1,2), (3,2,1), (1,3,2), (2,3,1).
MATHEMATICA
avoids1324[p_] := !AnyTrue[Subsets[Range[Length[p]], {4}], p[[#[[1]]]] < p[[#[[3]]]] < p[[#[[2]]]] < p[[#[[4]]]] &]; a[n_] := Count[Permutations[Range[n]], p_ /; avoids1324[p] && Last[p] != n]; Table[a[n], {n, 1, 8}]
PROG
(Python)
from itertools import permutations, combinations
def avoids1324(p):
for i, j, k, l in combinations(range(len(p)), 4):
if p[i] < p[k] < p[j] < p[l]:
return False
return True
def a(n):
return sum(1 for p in permutations(range(1, n+1)) if avoids1324(p) and p[-1] != n)
print([a(n) for n in range(1, 9)])
CROSSREFS
KEYWORD
nonn
AUTHOR
Charles Cornell Norton, Dec 06 2025
STATUS
approved
