OFFSET
0,4
FORMULA
a(n) = n! - A003319(n).
a(n) = Sum_{j=1..n-1} (n - j)!*A003319(j).
a(n) ~ n!*(2/n + 1/n^2 + 5/n^3 + 32/n^4 + 253/n^5 + 2381/n^6 + ...). This follows from Vaclav Kotesovec's formula in A003319, see A260503 for more coefficients. In particular 2*(n-1)! < a(n) for n >= 5.
PROG
(Python)
def A356291_list(size: int):
F, R, C = 1, [0], [1] + [0] * (size - 1)
for n in range(1, size):
F *= n
for k in range(n, 0, -1):
C[k] = C[k - 1] * k
C[0] = -sum(C[k] for k in range(1, n + 1))
R.append(F + C[0])
return R
print(A356291_list(23))
# The test predicate, not suitable for calculation:
def reducible(p) -> bool:
return any(i for i in range(0, len(p))
if all(p[j] < p[k]
for j in range(0, i)
for k in range(i, len(p))
))
from itertools import permutations
for n in range(8): print(len([p for p in permutations(range(n)) if reducible(p)]))
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Aug 02 2022
STATUS
approved