Update the array ' dp ' with the running sum of prime numbers within the range [ 1 , N ] Time Complexity is O ( n )
for i in range ( 1 , N + 1 ) : NEW_LINE INDENT if array [ i ] == 0 : NEW_LINE INDENT runningPrimeSum += i NEW_LINE DEDENT DEDENT