OFFSET
1,6
COMMENTS
For n >= 7, this is the number of permutations of [n] that avoid substrings j(j+6), 1 <= j <= n-6.
LINKS
Indranil Ghosh, Table of n, a(n) for n = 1..400
Enrique Navarrete, Generalized K-Shift Forbidden Substrings in Permutations, arXiv:1610.06217 [math.CO], 2016.
FORMULA
For n>=7: a(n) = Sum_{j=0..n-6} (-1)^j*binomial(n-6,j)*(n-j)!.
Note a(n)/n! ~ 1/e.
EXAMPLE
a(10)=2399760 since there are 2399760 permutations in S10 that avoid substrings {17,28,39,4(10)}.
MATHEMATICA
Table[Sum[(-1)^j*Binomial[n-6, j]*(n-j)!, {j, 0, n-6}], {n, 1, 23}] (* Indranil Ghosh, Feb 26 2017 *)
PROG
(Python)
f=math.factorial
def C(n, r):return f(n)/f(r)/f(n-r)
def A280920(n):
....s=0
....for j in range(0, n-5):
........s+=(-1)**j*C(n-6, j)*f(n-j)
....return s # Indranil Ghosh, Feb 26 2017
(PARI) a(n) = sum(j=0, n-6, (-1)^j*binomial(n-6, j)*(n-j)!); \\ Michel Marcus, Feb 26 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Enrique Navarrete, Jan 10 2017
STATUS
approved