Here, E frag ij is the energy of the capped fragment consisting of amino acids i and j. If these are not neighbors along the protein chain (i.e., j ̸ = i + 1), this dimer will in total contain four caps (two for each amino acid). Otherwise (i.e., j = i + 1), it will only contain two caps, and it becomes necessary to subtract the energy of the cap molecule E cap [i,j] that is lost when joining the two neighboring fragments.