PETfold uses a Nussinov style algorithm to calculate the consensus structure of an alignment with maximal expected overlap. The Nussinov algorithm uses dynamic programming to find the structure with the highest score. Let F (i, j) denote the maximal score of an RNA structure for the sequence s i . . . s j . Thus, we have