This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A370485 #17 Feb 19 2024 12:10:54 %S A370485 0,0,2,4,16,78,480,3436,28050,256868,2607584,29061022,352747696, %T A370485 4632195548,65432845858,989341728564,15942876295728,272777484786062, %U A370485 4938657746907200,94332342088674252,1895781452461383986,39987981759263286340,883322358371147863168 %N 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. %H A370485 Seiichi Manyama, <a href="/A370485/b370485.txt">Table of n, a(n) for n = 0..449</a> %F A370485 a(n) = A095816(n) - A002464(n). %F A370485 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 ). %e A370485 123 contains 3 consecutive number and 321 contains 3 consecutive number in reverse order. So a(3) = 6-2 = 4. %o A370485 (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)))) %Y A370485 Cf. A002464, A095816, A370390. %K A370485 nonn %O A370485 0,3 %A A370485 _Seiichi Manyama_, Feb 19 2024