(intermediates() needs only for the (n+1)th root of q1 to be calculated, then for q0 to be recursively multiplied by it (and could also be done more concisely by itertools.accumulate() but would require a lambda function and would be no more efficient))
(
intermediates()
needs only for the (n+1)th root of q1 to be calculated, then for q0 to be recursively multiplied by it (and could also be done more concisely byitertools.accumulate()
but would require a lambda function and would be no more efficient))