For any given N, u = [1,2,3,...,N] and v = [2017,2018,2019,...,2017+N-1]. Write a function that returns a vector that contains the following sequence: [1*2017, 2*2018, 3*2019,...,N*(2017+N-1)]. Hint: you might want to create vectors u and v. code example

Example: For any given N, u = [1,2,3,...,N] and v = [2017,2018,2019,...,2017+N-1]. Write a function that returns a vector that contains the following sequence: [1*2017, 2*2018, 3*2019,...,N*(2017+N-1)]. Hint: you might want to create vectors u and v.

def q5(N):
    """
    Input:
    N - the number of elements in u and v.

    Output:
    Returns the sequence: np.array([1*2017,2*2018,...,N*(2017+N-1)])

    Example:
    N = 5

    Output = np.array([ 2017  4036  6057  8080 10105])
    """
    u = # YOUR CODE HERE
    v = # YOUR CODE HERE

    # YOUR CODE HERE

    return

Tags:

Cpp Example