method for return array of range from inputted integer