def generate_pairs(n_rex):
    """Generate list of pairs that will attempt to swap configurations during
    replica exchange Monte Carlo. 
    """
    pairs = list(zip(range(n_rex), range(1,n_rex)))
    return pairs[::2], pairs[1::2]