Picture file name/numbering in DSLR cameras
To ensure that images in each of the cameras folders have unique names, the camera will assign each image a file name containing a four digit number, starting from 0001 and increasing numerically with each shot taken. By default when a new card is inserted in to the camera a new folder is created on the card and the file numbering will begin again at 0001.
DSLR cameras have a custom setting that enables the camera to "remember" the last file number on the current card and continue numbering sequentially when a new memory card is inserted in the camera (called sequential numbering). The benefit of this is that no two images will have the same file name when downloaded to computer, having duplicate file names can cause images to be overwritten.
By default sequential numbering is set to "OFF".
Sequential file numbering OFF - When a new card is inserted the current folder and file numbers are not continued, file numbering starts again in a new folder.
Sequential file numbering ON - When a new card is inserted the the camera can continue numbering files in sequence from the last file number on the previous card.
It is possible to change this setting with the following camera Custom Settings:

D100 CSM menu
D1 | Setting 29 - "OFF" is "0" and "ON" is "1" |
D1X/H | Setting 29 |
D100 | Setting 5 |
D40/D40X | Setup menu (Full) > File No. Seq. |
D50 | Setup menu (Detailed) > File No. Seq. |
D70/70s | Setup menu > File No. Seq. |
D80 | Setup menu (Full) > File No. Seq. |
D200 | Custom setting > d6 |
D2X/D2Xs | Custom setting > d4 |
D2H/D2Hs | Custom setting > d4 |