def generate_macs(num_to_gen, mac_oui, mac_4_5_octets):
    """
    generate a deterministic list of mac addresses to minimize total number of
    clients seen by Cortex IoT Guardian
    :param num_to_gen: how many macs to generate
    :param mac_oui: vendor portion of mac address
    :param mac_4_5_octets: 4th and 5th octets so only 6th octet changes
    :return: mac_list - list of num_to_gen length of MAC addresses
    """
    mac_prefix = f'{mac_oui}:{mac_4_5_octets}'
    mac_list = []

    for x in range(0, num_to_gen):
        # generate hex value as 6th octet value for each mac address
        # using the sequence value will keep deterministic vs a random mac address
        # the if conditional is used to prepend a zero if x hex value is single digit
        mac_6th = hex(x).split('x')[1]
        if len(mac_6th) == 1:
            mac_list.append(f'{mac_prefix}:0{mac_6th}')
        else:
            mac_list.append(f'{mac_prefix}:{mac_6th}')

    return mac_list