The Ljung Box statistic, also known as the modified Box Pierce statistic, is a function of the accumulated autocorrelations, ρi up to time lag m. It's calculated as:
Q(m)=n(n+2)i=1∑m(n−iρi2)
In this case, time lag = 3
Thus,
Q(3)=250×252(2490.32)+250×252(248−0.152)+250×252(247−0.12)=31.04