Create an array containing a range of elements