Read - http://www.arduino.cc/en/Tutorial/ShiftOut - carefully especially the part about red /green leds at the end.
The code should be something like below (not tested)
void loop()
{
for (unsigned int numberToDisplay = 0; ; numberToDisplay++) // it will automagically wrap around ..
{
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay % 256); lower byte
shiftOut(dataPin, clockPin, MSBFIRST, numberToDisplay / 256); higher byte
digitalWrite(latchPin, HIGH);
delay(500);
}
}
be aware 65535 * 500 millisec = 32767 seconds, thats about 9 hours for one loop...