When we roll a fair die, why is 6 the expected number of rolls after which we get our first 3? When we roll a fair die, why is the expected number of rolls after which we get our first 3 (or any number from 1 to 6) is 6 rolls?
This code finds the expected number of rolls after which we get our first 3(or any other number from 1 to 6) when we roll our die 10000 times:
s=0
p=1/6
for i in range(1,10**4):
  s+=((i*p)*((1-p)**(i-1)))
print(s)

output:
6.000000000000001

It makes some sense that after (approximately) 6 rolls I would have gotten all the 6 numbers on a fair die, but can someone explain it in a more intuitive way and also give a mathematical proof?
Why is the expected number of rolls after which we get our first 3, in 10000 rolls, the reciprocal of the probability of getting a 3 in 1 roll?

This answer consists of two parts.  The first part develops a basic insight about long sequences of repetitions of an experiment.  This insight is conveyed by a simple diagram of the experimental results.  The second part quickly answers the question by applying this insight.
The insight
Consider any probabilistic event, such as a 3 appearing in one roll of a die ("experiment $A$").  Its "probability" is intended to reflect the proportion of times this event occurs in very long sequences of the experiment.
One way to compute this proportion is to run a slightly different experiment, "experiment $B.$"  The second version repeats experiment $A$ up until the moment a prescribed outcome, such as 3, appears.  Let's refer to this outcome as $\omega.$  Let $N$ count how many iterations of experiment $A$ are needed until $\omega$ occurs.  When we repeat experiment $B$ we observe a sequence of realizations of such random variables: $N_1$ for the first occurrence, $N_2$ for the second, and so on.

This figure shows a schematic timeline in which the repetitions of experiment $A$ are plotted left to right.  Each occurrence of $\omega$ is noted.  The $N_i,$ by definition, count how many trials of experiment $A$ were needed to produce each successive $\omega.$  Evidently, $\omega$ occurs $n$ times out of $N_1+\cdots + N_n$ repetitions of experiment $A.$
Because experiment $A$ (rolling a die) is assumed to behave the same way each time and to have independent outcomes, the $N_i$ have identical distributions and are independent, too.  Let's use them to estimate how often $\omega$ appears in a long sequence of runs of experiment $A.$  Pick a large number $n$ of iterations of experiment $B,$ with outcomes $N_1, N_2,\ldots, N_n.$  This implies that $\omega$ occurred in exactly $n$ out of $N_1+N_2+\cdots+N_n$ iterations of experiment $A.$ The proportion estimates the chance of $\omega$ in experiment $A:$
$$\Pr(\omega) \approx \frac{n}{N_1+N_2+\cdots + N_n} = \frac{1}{\frac{1}{n}\sum_{i=1}^n N_i}.$$
(The second equality arises from the algebra of fractions: numerator and denominator were both divided by $n.$)
In the denominator appears an approximation to the expected value of experiment $B.$  As a matter of notation, let $N(\omega)$ refer to the generic outcome of experiment $B,$ so that we may express this fact as
$$E[N(\omega)] \approx \frac{1}{n}\sum_{i=1}^n N_i.$$
Weak laws of large numbers guarantee these approximations become arbitrarily good as $n$ increases.  Putting the results together, we see that

$$\Pr(\omega) = \frac{1}{E[N(\omega)]}.$$

The application
A die is fair when all its outcomes are equally likely.  With a six-sided die then, the sum of all six chances must be $1$ (axiomatically), implying each chance is $1/6.$  In the denominator of the foregoing result we can read off the expected time to roll any given face: it is $6,$ QED.
