23 Nov '06 05:362 edits

I'm writing a series of number labels and I need to ensure that the label is not read upside down so I underline any label that could be read upside down and if doing so would give a different number than reading it right way up. As I'm doing so I wonder, how many labels will need the underline?

Note:

A number can be read upside down if and only if it consists of only 0, 1, 6, 8 and 9. Leading zeroes are allowed in the upside down versions (so 1000 can be read upside down).

So how many labels do I have to underline when my series goes from 001 to 999? What about to 9999? Is there a general answer for a series ending at 10^N - 1?

EDIT: Although I did mention it, it should be properly stated that numbers will be padded with leading zeros to all have N digits (the same N as in the 10^N - 1) and that labels which when read upside down are the same do not need underlines (so if going to 999, 111 doesn't need an underline but 011 does).

EDIT2: The real thrust of the question will follow once the preliminary answers have been worked out.

Note:

A number can be read upside down if and only if it consists of only 0, 1, 6, 8 and 9. Leading zeroes are allowed in the upside down versions (so 1000 can be read upside down).

So how many labels do I have to underline when my series goes from 001 to 999? What about to 9999? Is there a general answer for a series ending at 10^N - 1?

EDIT: Although I did mention it, it should be properly stated that numbers will be padded with leading zeros to all have N digits (the same N as in the 10^N - 1) and that labels which when read upside down are the same do not need underlines (so if going to 999, 111 doesn't need an underline but 011 does).

EDIT2: The real thrust of the question will follow once the preliminary answers have been worked out.