I'm not sure how to translate the equation into code. Please help if you can, thank you!
Input: list of ints
Output: sum of 'powers' of contiguous subarrays modded by a constant value as an int
powers is defined as:

eg input: : [2, 3, 2, 1]
output: 69