def make_schedule(n,pattern):
    """
    Make up an auditing schedule (a list of sample size s values to use)
    start with 0
    do pattern, then pattern repeated by multipied by last/first, etc.
    end with n
    note that last/first does not need to be an integer.
    make_schedule(1000,[1,2])         # --> 0,1,2,4,8,16,32,64,128,256,512,1000
    make_schedule(1000,[1,2,5,10])    # --> 0,1,2,5,10,20,50,100,200,500,1000
    make_schedule(1000,[5,6])         # --> 0,5,6,7,8,10,12,14,17,21,25,30,37,44,53,64,77,...
    """
    schedule = [ 0 ]
    multiplier = 1
    next_s = 1
    while schedule[-1] < n:
        for x in pattern:
            next_s = int(x*multiplier)
            next_s = min(n,next_s)
            if next_s > schedule[-1]:
                schedule.append(next_s)
        multiplier *= float(pattern[-1])/float(pattern[0])
    return schedule