construct/mc low autocorrelation
construct/mc low autocorrelation: a task in MathConstructOptimize-Envs-harbor (Harbor dataset). For a sequence seq 0..28 with entries in {-1, +1}, define the aperiodic autocorrelations C k = sum {i=0}^{29-k-1} seq i seq i+k for k = 1..28 and the energy E = sum k C k^2.
The task
For a sequence seq[0..28] with entries in {-1, +1}, define the aperiodic autocorrelations C_k = sum_{i=0}^{29-k-1} seq[i]*seq[i+k] for k = 1..28 and the energy E = sum_k C_k^2.