Smallest Diversifying Exponent A pandigital number is an integer which contains every digit from 0 to 9 at least once. 1234567890, 1902837465000000, and 9023289761326634265 are all pandigital. For the purposes of this challenge, numbers such as 123456789 are not pandigital, since they do not contain a 0, even though 123456789 = 0123456789.

A diverse pair of integers is a pair of integers \$(a, b)\$ such that \$a^b\$ is pandigital. \$b\$ is called the diversifying exponent.

Challenge: Given an integer \$a\$, find the smallest corresponding diversifying exponent \$b\$. This is a code-golf, so the shortest program in bytes wins.

(You may assume that there exists such an exponent, that is, your program will not be given invalid input, such as a power of 10.)

Your solution must be able to handle at the minimum the given test cases, but it should theoretically handle all valid inputs.

This is A090493 on OEIS.

Test cases

2 -&gt; 68
3 -&gt; 39
4 -&gt; 34
5 -&gt; 19
6 -&gt; 20
7 -&gt; 18
8 -&gt; 28
9 -&gt; 24
11 -&gt; 23
12 -&gt; 22
13 -&gt; 22
14 -&gt; 21
15 -&gt; 12
16 -&gt; 17
17 -&gt; 14
18 -&gt; 21
19 -&gt; 17
20 -&gt; 51
21 -&gt; 17
22 -&gt; 18
23 -&gt; 14
24 -&gt; 19
25 -&gt; 11
26 -&gt; 18
27 -&gt; 13
28 -&gt; 11
29 -&gt; 12
30 -&gt; 39
31 -&gt; 11
32 -&gt; 14
33 -&gt; 16
34 -&gt; 14
35 -&gt; 19
36 -&gt; 10
1234567890 -&gt; 1
Brachylog (v2), 9 bytes

;.≜^dl10∧


Try it online!

This is a function submission. The TIO link contains a wrapper that makes a function into a full program.

Explanation

;.≜^dl10∧
 .≜        Brute-force all integers, outputting the closest to 0
;  ^         for which {the input} to the power of the number
    d        has a list of unique digits
     l10     of length 10
        ∧  (turn off an unwanted implicit constraint)