Abstract We study the so-called nonconventional averages in the context of lattice spin systems, or equivalently random colorings of the integers. For i.i.d. colorings, we prove a large deviation principle for the number of monochromatic arithmetic progressions of size two in the box [1,N]∩N, as N→∞, with an explicit rate function related to the one-dimensional Ising model. For more general colorings, we prove some bounds for the number of monochromatic arithmetic progressions of arbitrary size, as well as for the maximal progression inside the box [1,N]∩N. Finally, we relate nonconventional sums along arithmetic progressions of size greater than two to statistical mechanics models in dimension larger than one.