Hexadecimal numbers that does not look like decimal

127 Views Asked by At

Given a range of hexadecimal numbers, how do I determine the total number of them that do not look like decimal numbers?

Background: I'm designing a system that auto-generates IDs that consist of four digit hexadecimal numbers but I want to exclude those that looks like decimal numbers so that users are not confused. I only want to know that with that restriction, how many IDs can the system generate (and decide if I need to increase the number of digits or not).

N.B. I can easily detect if a hexadecimal number looks like a decimal number or not though.

1

There are 1 best solutions below

0
On

Number of numbers with at least an hex letter (a to f) as Travis commented $$16^{n} - 10^{n} = 55536$$

Number of numbers with no decimal at all (a to f only) $$6^{n} = 1296$$

Number of numbers with at least an hex letter (a to f) with no leading zero $$16^{n} - 10^{n} - 16^{n-1} + 10^{n-1} = 52440$$