Use a recursive function for constructing pandigital numbers