The adaptation of the recursion to the folding of two RNAs A and B of length n1 and n2 into a dimeric structure is straightforward: the two molecules are concatenated to form a single sequence of length n = n1 + n2. It follows from the algorithmic considerations below that the order of the two parts is arbitrary.