F#, 25 bytes
Seq.fold(fun s n->s+n-1)1
This is a function that takes in an array/list/sequence of integers and returns the required result.
How it works:
Seq.fold
allows you to apply a function to every element of a sequence while carrying some state around while it does so. The result of the function as applied to the first element will give the state that will be put into the function for the second element, and so forth. For example, to sum up the list [1; 3; 4; 10]
, you'd write it like this:
Seq.fold (fun sum element -> sum + element) 0 [1; 3; 4; 10]
( function to apply ) ^ (sequence to process)
( initial state )
Which would be applied like so:
// First, initial state + first element
0 + 1 = 1
// Then, previous state + next element until the end of the sequence
1 + 3 = 4
4 + 4 = 8
8 + 10 = 18
With the last state being the return value of Seq.fold
.