Closed from sum notation used instead of loops