The average number of rolls is approximately 5.294 for the specific case in the question.

The probability distribution for the specific case is:


$$
p(1) = \frac{1}{20}
$$

for \$n=1\$, and

$$
p(n) = \frac{n}{20} \prod_{i=1}^{n-1} \left( \frac{20-i}{20} \right)
$$

for \$n>1\$, and \$p(n)\$ indicates the probability that the success occurs on the n'th roll.


The general structure is

$$
p(n) = q_n \prod_{i=0}^{n-1} (1-q_i)
$$
where \$0 \le q_i \le 1\$ is the probability of success on the i'th roll, with the convention \$q_0=0\$ (you can't have succeeded before your first roll)


You can think of the process in terms of this sort of tree:

<pre>

        (1-q_0)=1
       /   \
     q_1  (1-q_1)                    # first roll
            /  \
           q_2 (1-q_2)               # second roll
                /   \ 
               q_3  (1-q_3)          # third roll
                      ...
</pre>
Where the branches to the left indicate success on that particular roll, and the branches to the right indicate failure on this particular roll.  Evaluating the probability of success on a given roll is just taking the product of the factors along the path to the "success" branch on that level.

For the specific case called out in the question:
<pre>

        start=1
       /   \
     1/20  19/20                    # first roll
            /  \
           2/20 18/20               # second roll
                /   \ 
               3/20  17/20          # third roll
                      ...
</pre>                  


From here we can tabulate the probabilities for the specific case:

| n  | p(n)|
|----|-----|
| 1  | 0.05 |
| 2 | 0.095]
| 3  | 0.12825 |
| 4 | 0.14535 |
| 5 | 0.14535 |
| 6 | 0.130815|
| 7 | 0.106832|
| 8 | 0.0793611|
| 9 | 0.0535687|
| 10 | 0.0327364|
| 11 | 0.0180050|
| 12 | 0.00883884 |
| 13 | 0.00383016|
| 14 | 0.00144368|
| 15 | 0.000464039|
| 16 | 0.000123743|
| 17 | 2.62956e-05|
| 18 | 4.17635e-06|
| 19 | 4.40937e-07|
| 20 | 2.32020e-08|

From, this you can get the average of 5.294.