Hey,
The range() method will give us integers from the start to the end. You can also specify a step to denote the interval.
You can use this to create an array to iterate on.
scala> var a=range(2,15)
a: Array[Int] = Array(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
scala> var b=range(15,2,-2)
b: Array[Int] = Array(15, 13, 11, 9, 7, 5, 3)