Question: Generating Symmetric Arrays over a Prime Field

I am working over F_p, where p is prime. When p = 2, the number of 2x2x2 arrays (aka hypermatrices or tensors) over this field is 2^(2*2*2) = 256. Of those 256 arrays, I only want the symmetric ones: that is, if x_{ijk} is the ijk-th element of the array X, then x_{ijk} = x_{ikj} = x_{jik} = x_{jki} = x_{kij} = x_{kji}. Is there a quick loop that does this? 

Please Wait...