Solving the 3x5 torus puzzle

Pensieve Header: Solving the 3x5 torus puzzle.

n=15; 
(Subscript[g, 1])=Cycles[{{1,6,11}}];
(Subscript[g, 2])=Cycles[{{2,7,12}}];
(Subscript[g, 3])=Cycles[{{3,8,13}}];
(Subscript[g, 4])=Cycles[{{4,9,14}}];
(Subscript[g, 5])=Cycles[{{5,10,15}}];
(Subscript[g, 6])=Cycles[{{1,2,3,4,5}}];
(Subscript[g, 7])=Cycles[{{6,7,8,9,10}}];
(Subscript[g, 8])=Cycles[{{11,12,13,14,15}}];

Clear[σ];
σ_∘τ_ := PermutationProduct[τ, σ];
Feed[Cycles[{}]]:=Null;
Feed[τ_]:=Module[{i,j,k,l},
i=Min[PermutationSupport[τ]];
j=PermutationReplace[i, τ];
If[Head[σ[i,j]]===Cycles,
Feed[InversePermutation[σ[i,j]]∘τ],
(*Else*) σ[i,j]=τ;
For[k=1, k<n, ++k,
For[l=k+1, l≤n, ++l,
If[Head[σ[k,l]]===Cycles,
Feed[σ[i,j]∘σ[k,l]]; Feed[σ[k,l]∘σ[i,j]]]
]]
]];
$RecursionLimit=∞;

Table[Feed[(Subscript[g, α])];(∏_(i=1)^n)(1+Count[Range[n], j_ /; Head[σ[i,j]]==Cycles]), {α, 8}]

15!

15!/2

ImageCrop[ 
Rasterize[Graphics[{
EdgeForm[Thin],
Table[
If[Head[(Subscript[σ, i,j])]===Cycles || i==j,
{Red, Rectangle[{i-1,n-j},{i,n-j+1}]},
{Yellow, Rectangle[{i-1,n-j},{i,n-j+1}]}
], {i,n}, {j,i,n}
]
}, AspectRatio -> 1/GoldenRatio, ImageSize -> 720], RasterSize -> 720]
]