When a picture is taken, the camera names the file by adding one to the last file number used. This option controls whether file numbering continues from the last number used when a new folder is created, the memory card is formatted, or a new memory card is inserted in the camera.
File Number Sequence
If the current folder is numbered 999 and contains either 5000 pictures or a photograph numbered 9999, the shutter-release button will be disabled and no further pictures can be taken (in addition, movie recording may be disabled if the camera calculates that the number of files needed to record a movie of the maximum length would result in the folder containing over 5000 files or a file with a number over 9999). Choose Reset for Custom Setting d7 (File number sequence) and then either format the current memory card or insert a new memory card.