Interesting, I actually never noticed this despite my love of Naval Aviation. Here is an excerpt from joebaugher.com/navy_serials/navyserials.html
where he discusses this:
According to one of my sources, the digits in the side numbers beyond the first one are in octal format (the digits going from 1 to 7, then from 10 to 17, 20 to 27, etc), with digits 8 or 9 never being used. This was supposedly done because maintenance actions were originally recorded on punched cards and had to be processed through IBM electronic accounting machines and computers which could only handle octal numbers. Curiously, the side numbers remain in octal format to this day even though computer systems have since been upgraded many times. However, I have seen side numbers beyond the first digit that do indeed have an 8 or a 9, so this restriction must not have been universal.
Another possible explanation for the origin of the octal side-number system is the nature of the early IFF (Identification Friend or Foe) systems. With the arrival of the Navy's E-2A airborne early warning aircraft, the side numbers changed from base-10 to base-8 numbering (e.g 500, 501, 502,..., 507, 510, 511, etc). The E-2As automatic tracking system required such a change, since its computers could only deal with base-8 numbrs. IFF is used by controllers for 'positive control'. There are several modes: two entered by the pilot at the direction of the controller, one for squawking altitude, and one reserved for military use. Early transponders were set by positioning toggle swithces ON or OFF, with there being four columns of 3 switches for a 4096 code or two columns of three for a 64-code. 4096 is the number of different four-digit numbers that can be created without using an 8 or a 9 and including 0000 which should never be used by airplane transponders. In such a scheme, there are 12 binary swiches. IFF can only handle three binary places, thus 8's and 9's are not used. IFF systems at that time (and I think they still do) used the octal system and the highest "squawk" in mode 2 was 7777, mode 1 and 3 was 77. Hence the appearance of octal numbering system on aircraft. There are no doubt a few reasons why octal rather than decimal is used, for one thing it accurately reflects the underlying "bit-oriented" nature of the codes. If decimals were used then for mode "A" (civilian, "3" military) only numbers ranging from 0 through 4096 would be useable, probably harder to understand than the ability to use any 4-digit number (0000-7777). Also, a previous military mode (mode "1") only allowed 6 bit codes (00-77), upward compatilbility is simplified if considered to be a doubling of the number of digits than if it were a case of suddenly being allowed to use numbers in the range 64 to 4096. The latest addition to radar technology, Mode-S, expands the squawk codes from 12 bits to 24 bits thus making it possible to permanently assign codes to individual aircraft without duplication. However, despite being a recent invention these codes are still represented using octal (as 8 digits) or hex (as 6 digits/letters).
5. February, 19:59