Servos and Random Number
You planning to use multiple servo, but only declare one. 
I still don't get about the pattern, but maybe this will give some image:

Servo myservo[5]; // assuming you have 5-servo
                  // servo[0]--&gt; pin 0
                  // servo[1]--&gt; pin 1
                  // servo[2]--&gt; pin 2
                  // servo[3]--&gt; pin 3
                  // servo[4]--&gt; pin 4
pos = 0;

void loop() {

BUTTON = digitalRead(button);
Serial.println(BUTTON);
 if(BUTTON == LOW){
  randomNumber = random(1,4);
  delay(275);
  pos+=randomNumber;
  Serial.print("Random Number ");
  Serial.println(randomNumber);
  Serial.print("Current pos ");
  Serial.println(pos);


 for (x = 0; x &lt; randomNumber; x++) { 
  myservo[x+pos].attach(x+pos);
  Serial.print("attach servo-");
  Serial.println(x+pos); }


//open (move from 0-180 degrees)
 for (x = 0; x &lt; randomNumber; x++) { 
  myservo[x+pos].write(180);
 }
 delay(2000);

//close (move from 180-0 degrees)
 for (x = 0; x &lt; randomNumber; x++) { 
  myservo[x+pos].write(0);
 }
 delay(2000);

//detach servo
 for (x = 0; x &lt; randomNumber; x++) { 
  myservo[x+pos].detach();
 }
 delay(2000);
}
}