A216723 Second column of A216722.
0, 0, 5, 18, 84, 568, 4122, 33910
Offset: 3
Keywords
References
- Wayne M. Dymacek, Isaac Lambert and Kyle Parsons, Arithmetic Progressions in Permutations, http://math.ku.edu/~ilambert/CN.pdf, 2012.
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.
For n=4 the a(4)=5 solutions are (0,1,3,2), (0,2,1,3), (0,2,3,1), (0,3,1,2) and (0,3,2,1).
f[i_,n_,k_]:=If[i==0&&k==0,1,If[i==n&&n==k,1,Binomial[k-1,k-i]*Binomial[n-k-1,k-i-1]+2*Binomial[k-1,k-i-1]*Binomial[n-k-1,k-i-1]+Binomial[k-1,k-i-1]*Binomial[n-k-1,k-i]]]; w1[i_,n_,k_]:=If[n-2k+i<0,0,If[n-2k+i==0,1,(n-2k+i-1)!]]; a[n_,k_]:=Sum[f[i,n,k]*w1[i,n,k],{i,0,k}]; A165962[n_]:=(n-1)!+Sum[(-1)^k*a[n,k],{k,1,n}]; Table[A165962[n],{n,3,23}] (* David Scambler, Sep 18 2012 *)
Triangle begins: 1 1 2 3 3 24 0 100 15 0 5 594 108 18 0 4389 504 119 21 0 7 35744 3520 960 64 32 0 325395 31077 5238 927 207 27 0 9 3288600 288300 42050 8800 900 100 50 0 ...
b:= proc(s, x, y, n) option remember; expand(`if`(s={}, 1, add( `if`(x>0 and irem(n+x-y, n)=2 and irem(n+y-j, n)=2, z, 1)* b(s minus {j}, y, j, n), j=s))) end: T:= n-> (p-> seq(coeff(p, z, i), i=0..max(0, iquo(n-1,2)*2-1)))(b({$1..n}, 0$2, n)): seq(T(n), n=0..11); # Alois P. Heinz, Apr 13 2021
b[s_, x_, y_, n_] := b[s, x, y, n] = Expand[If[s == {}, 1, Sum[ If[x>0 && Mod[n + x - y, n] == 2 && Mod[n + y - j, n] == 2, z, 1]* b[s~Complement~{j}, y, j, n], {j, s}]]]; T[n_] := Function[p, Table[Coefficient[p, z, i], {i, 0, Max[0, Quotient[n - 1, 2]*2 - 1]}]][b[Range[n], 0, 0, n]]; Table[T[n], {n, 0, 11}] // Flatten (* Jean-François Alcover, Mar 06 2022, after Alois P. Heinz *)
Triangle begins: 1 0 0 1 6 0 0 0 0 18 5 0 0 0 1 93 18 9 0 0 0 0 600 84 28 7 0 0 0 1 4320 512 192 0 16 0 0 0 0 35168 4122 810 156 54 9 0 0 0 1 321630 34000 5625 1400 200 0 25 0 0 0 0 ...
Comments