method to test whether a number is pandigital