login
A370485
Number of permutations of [n] with the property that no subsequence k(k+1)(k+2) or (k+2)(k+1)k occurs but k(k+1) or (k+1)k occurs.
1
0, 0, 2, 4, 16, 78, 480, 3436, 28050, 256868, 2607584, 29061022, 352747696, 4632195548, 65432845858, 989341728564, 15942876295728, 272777484786062, 4938657746907200, 94332342088674252, 1895781452461383986, 39987981759263286340, 883322358371147863168
OFFSET
0,3
LINKS
FORMULA
a(n) = A095816(n) - A002464(n).
G.f.: Sum_{k>=0} k! * x^k * ( ((1-2*x^2+x^3)/(1-x^3))^k - ((1-2*x+x^2)/(1-x^2))^k ).
EXAMPLE
123 contains 3 consecutive number and 321 contains 3 consecutive number in reverse order. So a(3) = 6-2 = 4.
PROG
(PARI) my(N=30, x='x+O('x^N)); concat([0, 0], Vec(sum(k=0, N, k!*x^k*(((1-2*x^2+x^3)/(1-x^3))^k-((1-2*x+x^2)/(1-x^2))^k))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Feb 19 2024
STATUS
approved