latin5={{{1,2,3,4,5},{2,3,5,1,4},{3,5,4,2,1},{4,1,2,5,3},{5,4,1,3,2}},{{1,2,3,4,5},{2,4,1,5,3},{3,5,4,2,1},{4,1,5,3,2},{5,3,2,1,4}}};

n=6;
For[j=1,j<3,j++,
latinc=Append[#,n]&/@latin5[[j]];
Okey:=Sort[Tally[Table[Count[#-x,0],{x,latinc}]]]=={{0,1},{1,n-2}}&;
possible= Join[Select[Permutations[Range[n]],Okey] ,latinc];
Print[j,". Remaining vectors:",Length[possible]];
conds=Tuples[{Subsets[Range[n],{2}],Permutations[Range[n],{2}]}];
Satisfied[perm_,cond_]:=perm[[cond[[1,1]]]]==cond[[2,1]] && perm[[cond[[1,2]]]]==cond[[2,2]];
matrix=Table[Boole[Satisfied[perm,cond]],{cond,conds},{perm,possible}];
If[Quiet[LinearProgramming[N[1& /@possible],matrix,{1,0}&/@conds]][[0]]==List,Print["Exists solution"],Print["No solution"],Print["No solution"]]]

j=1;
latinc=Append[#,n]&/@latin5[[j]];
Okey:=Sort[Tally[Table[Count[#-x,0],{x,latinc}]]]=={{0,1},{1,n-2}}&;
possible= Join[Select[Permutations[Range[n]],Okey] ,latinc];
conds=Tuples[{Subsets[Range[n],{2}],Permutations[Range[n],{2}]}];
Satisfied[perm_,cond_]:=perm[[cond[[1,1]]]]==cond[[2,1]] && perm[[cond[[1,2]]]]==cond[[2,2]];
matrix=Table[Boole[Satisfied[perm,cond]],{cond,conds},{perm,possible}];
c=0&/@possible;
maxweight=Table[LinearProgramming[N[ReplacePart[c,k->-1]],matrix,{1,0}&/@conds][[k]],{k,1,Length[possible]}]

latin6={{{1,2,3,4,5,6},{2,1,4,3,6,5},{3,4,5,6,1,2},{4,3,6,5,2,1},{5,6,2,1,4,3},{6,5,1,2,3,4}},{{1,2,3,4,5,6},{2,1,4,3,6,5},{3,4,6,5,2,1},{4,3,5,6,1,2},{5,6,2,1,3,4},{6,5,1,2,4,3}},{{1,2,3,4,5,6},{2,1,5,3,6,4},{3,4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2,5,4,6,1,3},{3,4,2,5,6,1},{4,6,1,2,3,5},{5,3,6,1,4,2},{6,1,5,3,2,4}},{{1,2,3,4,5,6},{2,5,4,6,3,1},{3,1,6,5,2,4},{4,3,2,1,6,5},{5,6,1,3,4,2},{6,4,5,2,1,3}},{{1,2,3,4,5,6},{2,6,1,5,4,3},{3,5,6,1,2,4},{4,1,5,6,3,2},{5,3,4,2,6,1},{6,4,2,3,1,5}},{{1,2,3,4,5,6},{2,6,1,5,4,3},{3,5,6,1,2,4},{4,1,5,6,3,2},{5,4,2,3,6,1},{6,3,4,2,1,5}},{{1,2,3,4,5,6},{2,6,4,1,3,5},{3,5,6,2,4,1},{4,3,5,6,1,2},{5,1,2,3,6,4},{6,4,1,5,2,3}},{{1,2,3,4,5,6},{2,6,4,3,1,5},{3,4,2,5,6,1},{4,5,1,6,3,2},{5,3,6,1,2,4},{6,1,5,2,4,3}},{{1,2,3,4,5,6},{2,6,4,5,3,1},{3,4,2,6,1,5},{4,5,1,2,6,3},{5,3,6,1,2,4},{6,1,5,3,4,2}}};

Dynamic[{j}]
n=7;
For[j=1,j<23,j++,
latinc=Append[#,n]&/@latin6[[j]];
Okey:=Sort[Tally[Table[Count[#-x,0],{x,latinc}]]]=={{0,1},{1,n-2}}&;
possible= Join[Select[Permutations[Range[n]],Okey] ,latinc];
Print[j,". Remaining vectors:",Length[possible]];
conds=Tuples[{Subsets[Range[n],{2}],Permutations[Range[n],{2}]}];
Satisfied[perm_,cond_]:=perm[[cond[[1,1]]]]==cond[[2,1]] && perm[[cond[[1,2]]]]==cond[[2,2]];
matrix=Table[Boole[Satisfied[perm,cond]],{cond,conds},{perm,possible}];
If[Quiet[LinearProgramming[N[1& /@possible],matrix,{1,0}&/@conds]][[0]]==List,Print["Exists solution"],Print["No solution"],Print["No solution"]]]

j=1;
latinc=Append[#,n]&/@latin6[[j]];
Okey:=Sort[Tally[Table[Count[#-x,0],{x,latinc}]]]=={{0,1},{1,n-2}}&;
possible= Join[Select[Permutations[Range[n]],Okey] ,latinc];
conds=Tuples[{Subsets[Range[n],{2}],Permutations[Range[n],{2}]}];
Satisfied[perm_,cond_]:=perm[[cond[[1,1]]]]==cond[[2,1]] && perm[[cond[[1,2]]]]==cond[[2,2]];
matrix=Table[Boole[Satisfied[perm,cond]],{cond,conds},{perm,possible}];
c=0&/@possible;
maxweight=Table[LinearProgramming[N[ReplacePart[c,k->-1]],matrix,{1,0}&/@conds][[k]],{k,1,Length[possible]}]

j=2;
latinc=Append[#,n]&/@latin6[[j]];
Okey:=Sort[Tally[Table[Count[#-x,0],{x,latinc}]]]=={{0,1},{1,n-2}}&;
possible= Join[Select[Permutations[Range[n]],Okey] ,latinc];
conds=Tuples[{Subsets[Range[n],{2}],Permutations[Range[n],{2}]}];
Satisfied[perm_,cond_]:=perm[[cond[[1,1]]]]==cond[[2,1]] && perm[[cond[[1,2]]]]==cond[[2,2]];
matrix=Table[Boole[Satisfied[perm,cond]],{cond,conds},{perm,possible}];
c=0&/@possible;
maxweight=Table[LinearProgramming[N[ReplacePart[c,k->-1]],matrix,{1,0}&/@conds][[k]],{k,1,Length[possible]}]

j=4;
latinc=Append[#,n]&/@latin6[[j]];
Okey:=Sort[Tally[Table[Count[#-x,0],{x,latinc}]]]=={{0,1},{1,n-2}}&;
possible= Join[Select[Permutations[Range[n]],Okey] ,latinc];
conds=Tuples[{Subsets[Range[n],{2}],Permutations[Range[n],{2}]}];
Satisfied[perm_,cond_]:=perm[[cond[[1,1]]]]==cond[[2,1]] && perm[[cond[[1,2]]]]==cond[[2,2]];
matrix=Table[Boole[Satisfied[perm,cond]],{cond,conds},{perm,possible}];
c=0&/@possible;
maxweight=Table[LinearProgramming[N[ReplacePart[c,k->-1]],matrix,{1,0}&/@conds][[k]],{k,1,Length[possible]}]