Write an algorithm to calculate the Least Common Multiple (LCM) of all pairs within a given array.
Implement pairwise_lcm(nums). For every unordered pair of distinct indices (i, j) where i < j, return its LCM in pair-generation order. Input values are positive integers, and the output is a list containing exactly n * (n - 1) / 2 integers.
def pairwise_lcm(nums):