# Upside Down Numbers

XanthosNZ
Posers and Puzzles 23 Nov '06 05:36
1. XanthosNZ
Cancerous Bus Crash
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.
2. pawnfondler
no edits
23 Nov '06 08:14
so any number in the 200,300,400,500 and 700 sections would be out? as well as any number with 2 3 4 5 and 7 in it. so would i be correct by saying find out how many numbers can be upside down in a single hundred section and multiply by 5? and same would apply for the 000-9999?
3. XanthosNZ
Cancerous Bus Crash
23 Nov '06 08:35
Originally posted by pawnfondler
so any number in the 200,300,400,500 and 700 sections would be out? as well as any number with 2 3 4 5 and 7 in it. so would i be correct by saying find out how many numbers can be upside down in a single hundred section and multiply by 5? and same would apply for the 000-9999?
You're forgetting that numbers that read the same either way up don't need an underline. The rest of your logic seems fine.
4. 23 Nov '06 08:43
Originally posted by XanthosNZ
Is there a general answer for a series ending at 10^N - 1?
probably.
The number of candidates for underlining is 5^N - 1
Then we need to weed out those that are symmetrical, like 010, 818, 619 which should be formulaic

for N=3 symmetricals = (5x3)-1
for N=4 symmetricals = (5x5)-1
for N=5 symmetricals = (5x5x3)-1
for N=6 symmetricals = (5x5x5)-1
and I guess
for N=7 symmetricals = (5x5x5x3)-1
for N=8 symmetricals = (5x5x5x5)-1

for N=3 underlines = (5^3)-1 - ((5x3)-1) = 124 - 14 = 110
for N=4 underlines = (5^4)-1 - ((5x5)-1) = 624 - 24 = 600
5. 24 Nov '06 13:18
for N=1 symmetricals = (3)-1
for N=2 symmetricals = (5)-1

for N=1 underlines = (5^1)-1 - ((3)-1) = 4 - 2 = 2
for N=2 underlines = (5^2)-1 - ((5)-1) = 24 - 4 = 20
6. 28 Nov '06 11:00
5^n - ( 5^INT(n/2) x 3^INT((n+1)/2) )