Arduino serial port eats data for 3 seconds before it sends?
Is this a Leonardo or Yun?  If it is, you have to wait until the Serial object says the USB connection is really ready:

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB
}


Read this.

Because you did't wait, your loop is able to execute 3000 times before Serial actually sends something back to the PC.