# Maple code for the case n=4, included to clarify the definition.
# It gives 125 as the answer.  N. J. A. Sloane, Jan 19 2012
with(combinat); A:=Matrix(4, 4): for i from 1 to 4 do A[i, i]:=0; od:
n:=0;
for a from 1 to 1 do A[1, 2]:=a; A[2, 1]:=a;
for b from 1 to 1 do A[1, 3]:=b; A[3, 1]:=b;
for c from 1 to 1 do A[1, 4]:=c; A[4, 1]:=c;
for d from 1 to 1 do A[2, 3]:=d; A[3, 2]:=d;
for e from 1 to 1 do A[2, 4]:=e; A[4, 2]:=e;
for f from 1 to 1 do A[3, 4]:=f; A[4, 3]:=f;
perms:=permute(4); nsw:=+1;
for i from 1 to 24 do
p:=perms[i];
w:=p[1]; x:=p[2]; y:=p[3]; z:=p[4];
star:=A[w, x]*A[y, z]+A[w, y]*A[x, z]+A[w, z]*A[x, y]A[w, x]*A[w, y]*A[w, z]*A[x, y]*A[x, z]*A[y, z];
if star <> 0 then nsw:=1; break; fi;
od:
if nsw = 1 then n:=n+1; fi;
od: od: od: od: od: od:
n;
