How do I do this program?

Alright, I've restored the code and here's the "new" one:

int x=0;
int buttonState;
void setup() {
  Serial.begin(9600);
  pinMode(7, INPUT_PULLUP);
}
void loop() {
    buttonState=digitalRead(7);
  if((buttonState==LOW)&&(x<=4)){
    Serial.print(1 << x);
    Serial.print(x, DEC);
    Serial.println(x, BIN);
  }
  x=x+1;
}