close
login
A387861
Number of black-white-balanced permutations of [n].
0
0, 0, 4, 16, 0, 0, 2592, 20736, 0, 0, 17280000, 207360000, 0, 0, 497871360000, 7965941760000, 0, 0, 41811635109888000, 836232702197760000, 0, 0, 8162188661918269440000, 195892527886038466560000, 0, 0, 3197077993687511224811520000, 89518183823250314294722560000
OFFSET
1,3
COMMENTS
Color the cells of the bargraph of a permutation in a chessboard style, such that the southwestern cell is black. The permutation is said to be black-white-balanced if it contains an equal number of black and white cells.
FORMULA
a(n) = 0 if n==1,2 (mod 4) and a(n) = floor(n/2)! * ceiling(n/2)! * binomial(ceiling(n/2), ceiling(n/2)/2) * binomial(floor(n/2), ceiling(n/2)/2) if n==0,3 (mod 4).
EXAMPLE
These are the 6 permutations of 1,2,3:
* o * o * *
*o *o o o o* o o o*
*o* *o* *o* *o* *o* *o*
123 132 213 231 312 321
All but the first and last are bw-balanced. Thus, a(3) = 4.
MATHEMATICA
a[n_]:=If[MemberQ[{1, 2}, Mod[n, 4]], 0, Floor[n/2]! * Ceiling[n/2]! * Binomial[Ceiling[n/2], Ceiling[n/2]/2] * Binomial[Floor[n/2], Ceiling[n/2]/2]]; Array[a, 28] (* Stefano Spezia, Sep 11 2025 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Sela Fried, Sep 10 2025
STATUS
approved