OFFSET
0,3
FORMULA
a(n) = n! - 6(n-2)! for n>=3.
-(n+1)*(n-4)*a(n) +(n-2)*(n-3)*(n+2)*a(n-1)=0 for n>=4 - R. J. Mathar, Nov 07 2017
EXAMPLE
There are 12 ways that permutations of 4 can have 1, 2, and 3 together. They are: 1234, 1324, 2134, 2314, 3124, 3214, 4123, 4132, 4213, 4231, 4312, 4321. Since there are 24 permutations, a(4) = 24-12 = 12
MATHEMATICA
Table[If[n < 3, n!, n! - 6 (n - 2)!], {n, 0, 22}] (* Michael De Vlieger, Mar 07 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Chris Wu, Mar 07 2016
STATUS
approved