This is the same as the previous return a result ---having processed all elements. The following version of predicate triple/2 is described as building structure in the clause head:
triple(,).We can see this if we think of the output argument as a structure which is to be constructed out of two parts: a bit we can calculate easily ( H2) and another bit which requires a recursive call to determine its structure ( T2). The term [H2T2] just shows how the result is constructed out of these bits.
H2 is 3*H1,