Generally they are all constructed as the summation of the squared auto correlation coefficients up to mth order. ( in your case is 6). 
The basic idea is that if Q(m) is zero, every auto correlation coefficients up to mth order should be zero. (e.g. if a^2+b^2=0, a=0 and b=0)
The degree of freedom is adjusted so that to let the statistic follow chi-square distribution.
The original version is very simple:
 
The modified one is:
 
The tao here are auto correlation coefficients. T is the number of observations.
I think we use modified one more often.
best,